Subject: RE: select call implementation and threads
To: 'Bill Studenmund' <wrstuden@netbsd.org>
From: Huy Vu <hvu@hyperchip.com>
List: tech-kern
Date: 05/27/2003 16:42:45
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C32490.86CB3220
Content-Type: text/plain;
charset="iso-8859-1"
> I think the key problem is that you're trying to have two simultaneous
> select calls going on. Since to the kernel there is only one thread, there
> can only be one select going on at once.
I'm currently using libpth and it works great (once you know the
limitations)
The key thing to remember is that: You have to make sure that ALL your
blocking system calls are stubbed out with the pth_* calls.
For example instead of using "select" you use "pth_select" for "read" you do
"pth_read" that way ALL blocking calls get routed to the pth scheduler where
it can be multiplexed correctly.
Regards,
Huy
------_=_NextPart_001_01C32490.86CB3220
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: select call implementation and threads</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>> I think the key problem is that you're trying to =
have two simultaneous</FONT>
<BR><FONT SIZE=3D2>> select calls going on. Since to the kernel =
there is only one thread, there</FONT>
<BR><FONT SIZE=3D2>> can only be one select going on at once.</FONT>
</P>
<P><FONT SIZE=3D2>I'm currently using libpth and it works great (once =
you know the limitations)</FONT>
</P>
<P><FONT SIZE=3D2>The key thing to remember is that: You have to make =
sure that ALL your blocking system calls are stubbed out with the pth_* =
calls.</FONT></P>
<P><FONT SIZE=3D2>For example instead of using "select" you =
use "pth_select" for "read" you do =
"pth_read" that way ALL blocking calls get routed to the pth =
scheduler where it can be multiplexed correctly.</FONT></P>
<P><FONT SIZE=3D2>Regards,</FONT>
<BR><FONT SIZE=3D2>Huy</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C32490.86CB3220--