[clug] pthread coroutines
Simon Burton
simon at arrowtheory.com
Thu Jul 3 08:05:02 EST 2003
On Wed, 2 Jul 2003 23:24:17 +1000
Jepri <jepri at webone.com.au> wrote:
> Waitaminit - I just read that with my thinking cap on...
>
> If you only want one out of two threads running all the time, there is
> a common, simlpe portable solution...
>
> use a single threaded application.
>
> I assumed that you wanted to generalise this to n threads, but from
> your responses it looks like you really only have two threads running,
> and only one at a time.
>
> Obrant:
> There are only a few cases where threading really helps, most of the
> rest are situations where a non-blocking calls and forking would serve
> just as well.
>
Yeah, i hear you. Believe me i avoid threads as much as i can.
In this case i am interfacing to the portaudio library, it uses a callback,
and i'm not up to slaving the whole of python and python scripts to such a callback,
so now they are different threads ... etc. etc.
I am thinking about "n threads", and weather this mutex stuff (ie. kernel scheduling) would scale,
it's kinda interesting.
Simon.
--
Simon Burton, B.Sc.
Licensed PO Box A66
ANU Canberra 2601
Australia
Ph. 02 6249 6940 \
------------------------\
------------------------/
http://arrowtheory.com /
More information about the linux
mailing list