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
dsp_ready.
If the idle event occurs but dsp_ready is 0, then it will simply sleep 1ms
and return.
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.

AJ ONeal
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to