Example of custom backend with thread?
coolaj86 at gmail.com
Tue Dec 21 21:17:27 CET 2010
I have a function to process data on a DSP which blocks
and a network socket which gives data to process.
I have the event loop such that once a client has sent all data (and it is
copied into a buffer) it starts the idle watcher (if not already started),
which contains the call to the DSP function.
Yet while the DSP is crunching I want to still be able to accept new data.
My current solution is to create a thread and a nasty global called
If the idle event occurs but dsp_ready is 0, then it will simply sleep 1ms
The dsp function changes dsp_ready when it starts and is done processing.
Please point me to an example of the proper way to do this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the libev