yield equivalent in C/JavaScript?

Robin Becker robin at jessikat.fsnet.co.uk
Sun Jun 30 00:43:54 CEST 2002


In message <60FB8BB7F0EFC7409B75EEEC13E201922151B8 at admin56.narex.com>,
Bjorn Pettersen <BPettersen at NAREX.com> writes
>> From: Robin Becker [mailto:robin at jessikat.fsnet.co.uk] 
>> 
>> Is there any way to do yielding easily in C? I have a bunch 
>> of programs which are normally connected together using unix 
>> pipes. I would like to merge them and the problem is then how 
>> to get them to communicate nicely using a single process.
>
>Using threads, you can simulate yield by having the yielding thread
>blocking until the thread calling it tells it to restart. This is rather
>obscure however, so I wouldn't suggest that you do it. If you are going
>to use threads, I would suggest using a Queue to communicate
>work/results (I can send you our C++ version of Python's Queue.Queue()
>implementation if that would help...)
>
>-- bjorn
thanks I know how to do this with threads, but I suspect I will end up
doing this in JavaScript and threading is a complete mystery there (if
it exists).
-- 
Robin Becker





More information about the Python-list mailing list