Thanks guys. Just to record it somewhere, I ended up doing this in a
somewhat different but satisfying way – using ZMQ:
https://gist.github.com/StefanKarpinski/10083996. Since the next step after
getting two threads to communicate is inevitably to add a threadsafe
queuing mechanism, you might as well cut to the chase and just use ZMQ
right away. Especially since the ZMQ package already does all the heavy
lifting to make this easy. Bonus: if you ever decide to move from a
multiple thread model to a multiple process model – even a distributed one
– you barely have to change your code.


On Mon, Apr 7, 2014 at 9:25 PM, Jameson Nash <[email protected]> wrote:

> `status` used to equal 0 (success), now it is just a random number
> (whatever happens to be in the register/stack location of this
> argument that no longer exists in libuv, but never got remove from
> Julia): https://github.com/joyent/libuv/blob/v0.8/include/uv.h#L291
>
> the first argument to every libuv callback is the julia reference to
> the object that caused the callback to trigger. In this case, as
> Steven mentioned, this is a SingleAsyncWork object
>
> possibly related: https://github.com/JuliaLang/julia/issues/1933
>
> On Mon, Apr 7, 2014 at 2:32 PM, Steven G. Johnson <[email protected]>
> wrote:
> > "data" in this example will be notifyasync (i.e., the SingleAsyncWork
> object
> > whose handle was sent to uv_async_send); might be nicer to call it
> "work".
> > No idea what "status" is.
> >
> > Would be good to document this in the manual (it only says "you'll most
> > likely just discard" the callback parameters).   In the case of ZMQ, I
> > actually use the "data" parameter
> > (https://github.com/JuliaLang/ZMQ.jl/blob/master/src/ZMQ.jl#L316-L334).
>

Reply via email to