Bug 24418

Summary: read/write in thread library (-lc_r) does not do context switch
Product: Base System Reporter: Jin Guojun <jin>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   

Description Jin Guojun 2001-01-18 01:00:00 UTC
	threaded read/write shoule not block on I/O till I/O completion.
	Blocking on I/O causes thread I/O meaningless.

	read does context switch on stdin, and this is probably only
	I/O sys-call that FreeBSD does the context switch on thread.
	Thread does not do context switch on disk I/O and timed select().
	I have not tested accept() and network I/O yet.

	Linux 2.2.x does not do context switch on thread I/O either,
	but linux 2.4.0 fixed it.
	Solaris does this well.
	Both Solaris and Linux 2.4.0 submit the I/O job to the driver,
	and immediately switch context to another thread regardless
	how less the I/O data is.
	This contest switch utilizes both system CPU and I/O CPU time.
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2001-06-02 10:40:42 UTC
Responsible Changed
From-To: freebsd-bugs->jasone

Jason is a threads guru.
Comment 2 Jason Evans freebsd_committer freebsd_triage 2002-05-11 23:21:41 UTC
Responsible Changed
From-To: jasone->freebsd-bugs
Comment 3 Archie Cobbs freebsd_committer freebsd_triage 2002-09-09 22:50:00 UTC
State Changed
From-To: open->closed

Submitter is no longer reachable, and bug is likely fixed now anyway.