[comp.sys.sun] Do lightweight processes work?

feldman@comet.Tymnet.COM (Steve Feldman) (05/25/90)

We're considering writing some code using Sun's lightweight process
(-llwp) and non-blocking I/O (-lnbio) libraries.  Are there any known
problems we should watch out for?  We're currently running SunOS 4.0.3,
though we could upgrade to 4.1 if we ever get the rest of the
distribution.

	Steve Feldman
	BT Tymnet
	feldman@Tymnet.COM

carl@aurora.com (Carl Stehle) (05/31/90)

In article <8134@brazos.Rice.edu> feldman@comet.Tymnet.COM (Steve Feldman) writes:
>
>We're considering writing some code using Sun's lightweight process
>(-llwp) and non-blocking I/O (-lnbio) libraries.  Are there any known
>problems we should watch out for?

LWP's worked out quite well for us, but watch out for the following:

1. Sun states that the Standard I/O library is non-reentrant for lwp's,
   (man lwp_sleep) so you will either need to isolate its use to one lwp at a
   time or use monitors.

2. I was unable to get dbx to work with -lnbio, but I don't know who's bug
   that is :-)

3. I assume that you are using cc and not gcc, as the latter handles
   structure parameters different than cc. (Yes, structures are passed in
   some lwp calls, sigh).

4. SELF appears to work only for the initial lwp and not others.

You wisely choose -lnbio, as the entire lwp "pod" would be blocked by an
I/O call by any of the lwp's.

-Carl