[M3devel] thread suspend/resume?

Jay K jay.krell at cornell.edu
Sun Nov 15 04:44:00 CET 2009


Here is an interesting note:

 

http://www.usenix.org/publications/library/proceedings/usenix01/freenix01/full_papers/wood/wood_html/index.html

 

 

They implement thr_suspend/thr_continue over pthreads very very much like we do.

They use signals and semaphores.

They use different signals for suspend vs. resume.

  I think we use only one and should look into how/why.

They only suspend one thread at a time, using a global semaphore.

  I think we do the same -- only one thread can be in the GC suspending other threads at a time.

 



 - Jay

 


From: jay.krell at cornell.edu
To: hosking at cs.purdue.edu; m3devel at elegosoft.com
Date: Sun, 15 Nov 2009 03:33:59 +0000
Subject: Re: [M3devel] thread suspend/resume?



(just based on the checkin comment, haven't looked at the code)
 
Interesting.
Should we use these sorts of functions more?
  Direct non-Posix somewhat target-dependent thread suspend/resume?
NetBSD appears to have suspend/resume but maybe not "all".
Solaris has them too, thr_suspend((thread_t)pthread), and thr_continue.
I don't see an "all" function but haven't looked fully.
I see some evidence that Linux has them too but haven't tracked it down.
NT already uses SuspendThread/ResumeThread.
That leaves? Nothing at all?
 Ok I should look into Irix, AIX, HP-UX, OpenVMS, Tru64.
 And this stuff doesn't work yet for OpenBSD, it's using user threads.
 
 
Maybe thread suspend/resume is the "portable enough" interface, implement
it fairly directly with #ifdefs and only use the signals/semaphore on few systems?
 
 
(note that Darwin does have the semaphores that are avoided here,
just slightly different Mach semaphores)

 - Jay
 
> Date: Sat, 14 Nov 2009 22:41:39 +0000
> To: m3commit at elegosoft.com
> From: hosking at elego.de
> Subject: [M3commit] CVS Update: cm3
> 
> CVSROOT: /usr/cvs
> Changes by: hosking at birch. 09/11/14 22:41:39
> 
> Modified files:
> cm3/m3-libs/m3core/src/thread/PTHREAD/: ThreadPThreadC.c 
> 
> Log message:
> Reorder for readability.
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091115/ce0a1bbf/attachment-0002.html>


More information about the M3devel mailing list