<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
sysutils has somewhat of a need to know if it is using user threads.<BR>
We've been over this multiple times through the years.<BR>
Never seems to be 100% resolved, but a solid 99%.<BR>
 <BR>
 <BR>
It runs a process and waits.<BR>
Historically in sysutils and m3core this was sleep/wait(nohang) in a loop.<BR>It was identified by people as a major performance problem.<BR>
 Because the process exits fairly quickly but you have to wait for the sleep to finish.<BR>
 Sleep being Modula-3 Thread.Sleep I guess -- call into the user thread scheduler.<BR>
By and by, most platforms got kernel threads. Changing it to be wait(hang)<BR>
became good, faster, no deadlock. But openbsd comes along with lame<BR>
pthreads, usermode at that, so we use user threads, and wait(hang)<BR>
could deadlock..<BR>
 <BR>
 <BR>
There is an interface in m3core to handle this stuff, but if<BR>
you bootstrap from an old build, it isn't there.<BR>
 <BR>
 <BR>
Mitigating factor as I understand that we don't use threads agressively,<BR>
so the deadlock isn't actually likely.<BR>
"we" meaning code that launches processes.<BR>
 <BR>
 <BR>
I understand that ideally you don't care if you are using userthreads or kernelthreads.<BR>
But the abstraction historically was incomplete.<BR>
 <BR>
 <BR>
 - Jay<BR><BR> <BR>> From: hosking@cs.purdue.edu<BR>> Date: Wed, 10 Feb 2010 10:16:24 -0500<BR>> To: jkrell@elego.de<BR>> CC: m3commit@elegosoft.com<BR>> Subject: Re: [M3commit] CVS Update: cm3<BR>> <BR>> Huh? Cryptic comment.<BR>> <BR>> On 10 Feb 2010, at 12:20, Jay Krell wrote:<BR>> <BR>> > CVSROOT: /usr/cvs<BR>> > Changes by: jkrell@birch. 10/02/10 12:20:55<BR>> > <BR>> > Modified files:<BR>> > cm3/m3-libs/sysutils/src/POSIX/: m3makefile <BR>> > <BR>> > Log message:<BR>> > I had this change around: expose if we are using user threads, i.e. if we are OpenBSD<BR>> <BR>                                           </body>
</html>