[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Coroutines / Threads



> -----Original Message-----
> From: Tim Teulings [mailto:tim@edge.ping.de]
> Sent: Thursday, December 17, 1998 1:03 PM
> To: ooc-list@informatik.uni-kl.de
> Subject: Re: Coroutines / Threads
>
> I have ported enough of the pthreads header of my Redhat Linux to get a
> minimal "al threads do cnsole output at the same time" program up and
> running. However since I had no need for threads and since it was not
> clear how threads would interact with the gc I did not move on. I can
> send you the PThreads.Mod if you like.

Yes, please do.

> The library does not directly support threads. It is up to the user
> using mutex ans semaphores to protect the library. Perhaps there are
> also some global variables, making problems using multiple
> tasks/threads.

Right.  Better to walk before we try to run.  Because coroutines require
explicit transfer of control, it should be easy to avoid problems.  To
actually implement parallel threads of execution, an explicit lock will be
needed during the transition when making calls into non-threadsafe library
functions.  The eventual objective should be to create a completely
threadsafe library.