On Sun, 2 Sep 2001, David Schwartz wrote:
>
> > I was playing around with pth trying to find out how to use it with a
> > server using disk I/O. The program below is based on the example found
> > in the manual page. If I comment out the call to pth_yield in the
> > handler, the program will serialize all requests. What is the "right"
> > way to make pth schedule other threads, like the main thread accepting
> > new connections?
>
> Really, the only answer to your question is that Pth provides cooperative
> multi-tasking. It's up to you to decide when you want your threads to yield
> the CPU to other threads that might be able to run. One way to do this is to
> put 'pth_yield' calls in strategic places. If you really need I/O
> concurrency, you really shouldn't use Pth and on FreeBSD 4, you should use
> the LinuxThreads port.
Just for info: There is also some further developement based on the pth,
where Pth threads run on top of native threads, which give you two level N:M
threading. Sorry, can't supply url, it is somewhere on the IBM site.
>
> DS
>
> ______________________________________________________________________
> GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
> User Support Mailing List [EMAIL PROTECTED]
> Automated List Manager (Majordomo) [EMAIL PROTECTED]
>
Igor Khasilev |
PACO Links, igor at paco dot net |
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]