Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Threads on different unix systems
Date: 1995/07/11	[thread overview]
Message-ID: <3ttg7h$dkh@engnews2.Eng.Sun.COM> (raw)
In-Reply-To: 3tt6qc$e4t@newsbf02.news.aol.com

interbase@aol.com (Interbase) writes:

>If indeed you do use the underlying system call - read() in this case -
>then yes, the process would block. One approach to handling I/O so that 
>other threads run (without kernel support) would be to use the select() 
>or poll() system calls to determine when I/O can be done. The library 
>can then suspend a thread which requests I/O, do the I/O when the 
>select() or poll() call indicates that it is possible, and re- schedule 
>the thread afterward. To prevent blocking in certain cases, each opened 
>file descriptor can be marked as non- blocking. For the case where a 
>non-blocking call returns a partially filled request under conditions in 
>which the blocking equivalent would not, the library would need some 
>additional logic to preserve the proper semantics. 

Of course there are many advantages to kernel threads over non-kernel
threads:
	- if one thread blocks on a short-term read (normal file read,
	  wait for disk I/O) another thread can get scheduled.
	- if one thread gets a page fault, other threads can continue
	- if you have multiple processors, your threads can use them

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.



  reply	other threads:[~1995-07-11  4:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-07-09  4:00 Threads on different unix systems Andrew Gabriel
1995-07-10  4:00 ` Jari Tavi
1995-07-11  4:00   ` Bob Myers
1995-07-10  4:00 ` John Polstra
1995-07-10  4:00 ` Bil Lewis
1995-07-11  4:00 ` Interbase
1995-07-11  4:00   ` Casper H.S. Dik - Network Security Engineer [this message]
1995-07-14  4:00     ` Jeffrey M. Denham
     [not found]   ` <3ttg7h$dkh@engnews2.eng.sun.com>
1995-07-11  4:00     ` Jeff Dickson
1995-07-12  4:00       ` Guy Harris
1995-07-14  4:00       ` Interbase
1995-07-14  4:00         ` J M Thompson
1995-07-12  4:00   ` Thong Ly
1995-07-12  4:00     ` Jari Tavi
1995-07-13  4:00       ` Guy Harris
1995-07-14  4:00       ` Daniel Wood
1995-07-22  4:00         ` Mark J Hewitt
1995-07-12  4:00     ` corey
1995-07-12  4:00       ` Darren R. Davis
1995-07-12  4:00         ` Bil Lewis
1995-07-12  4:00         ` Bryan Althaus
1995-07-13  4:00           ` Darren R. Davis
1995-07-18  4:00             ` Tim Wake
1995-07-12  4:00       ` Larry Rosenman
1995-07-11  4:00 ` David Stone
1995-07-13  4:00 ` Honbo Zhou
1995-07-13  4:00 ` Marc Maathuis
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox