LibEvent, signals or communication between threads

Sean Kelly sean at invisibleduck.org
Tue May 8 08:50:24 PDT 2012


On May 8, 2012, at 3:25 AM, "Shadow_exe" <shadow_exe at ukr.net> wrote:

> Hello everyone.
> Faced with an interesting challenge, and how to solve it and found no tracks.
> The problem is the following:
> I have 2 thread, which are created in the main flow, respectively, of each other, they do not know, but I want to create a dialogue between the thread. I want to first thread could tell the second thread to perform some function.
> The queue is implemented through a library libevent.
> 
> Who faced a similar problem or just knows how to solve this issue - please help.

If you're already using libevent you can either send the message via a socket or send the message using std.concurrency and then signal the other thread by writing to a socket it's reading. You can call receiveTimeout(0) to not block on receive. 


More information about the Digitalmars-d mailing list