(I maintain the bindings and this mailing list is fine for now. Bug reports
work too)

Right now rust-zmq is a pretty straightforward binding of the zeromq
library, and is not integrated with rust's scheduler. So it's not yet
preventing the user from two tasks from deadlocking. The only safe way to
deal with that is to spawn those tasks off in their own thread.

The best thing would be for us to write our own zmq implementation in rust,
but that'll take quite a while to write. Or perhaps there is some way we
can feed the ZMQ_FD of a socket to libuv to protect against task
deadlocking.

On Friday, November 8, 2013, Philippe Delrieu wrote:

> I found the problem. Rust schedules task in the same thread. If I stop the
> thread (the recv call sleep I think), every task stop.
> So I read the doc and I see the spawn_sched method that start a new
> scheluder in a new thread.
>
> I replace the do spawn with do 
> std::task::spawn_sched(std::task::SingleThreaded)
> and now it work.
>
> Philippe Delrieu
>
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to