Skip to content

messenger should use zmq syncronously and block#176

Closed
aebrahim wants to merge 2 commits intoarokem:masterfrom
aebrahim:zmq_sync
Closed

messenger should use zmq syncronously and block#176
aebrahim wants to merge 2 commits intoarokem:masterfrom
aebrahim:zmq_sync

Conversation

@aebrahim
Copy link
Contributor

@aebrahim aebrahim commented Apr 3, 2015

By using the asyncronous API while listening, excessive CPU usage
occurs.

A longer-term workaround may be to use a poller with a reasonable
timeout (such as 20ms).

This fixes #175.

Now can autodetect MATLAB on unix, and fixes bugs with running on both
unix/windows.
@aebrahim
Copy link
Contributor Author

aebrahim commented Apr 3, 2015

If this is an acceptable change I can also update the windows mex.

@blink1073
Copy link
Collaborator

The asynchronous api is needed to support the floating Matlab figures. I'd recommend a poller or adding a pause after the drawnow call.

@aebrahim
Copy link
Contributor Author

aebrahim commented Apr 4, 2015

I just added a commit which uses the poll function every 20ms.

By using the asynchronous API while listening constantly, excessive CPU
usage occurs.

Instead, this commit uses the synchronous version of zmq_recv, and uses
zmq_poll with a timeout of 20ms to ensure the graphics are updated.

This fixes #175.
@blink1073
Copy link
Collaborator

We need the messenger file to support Octave, so no go on undocumented Matlab function.

@aebrahim
Copy link
Contributor Author

aebrahim commented Apr 4, 2015

OK. I removed the ctrl c stuff and the undocumented function.

@blink1073
Copy link
Collaborator

LGTM, thanks @aebrahim.

@aebrahim
Copy link
Contributor Author

aebrahim commented Apr 4, 2015

:)

I made a second pull request (#178) which adds the compiled mex for windows/Linux

@blink1073 blink1073 closed this Apr 4, 2015
@blink1073
Copy link
Collaborator

Closed in favor of #178.

@aebrahim aebrahim deleted the zmq_sync branch June 12, 2015 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Very high CPU usage by MATLAB process

2 participants