<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
[truncated again]<BR>
<BR><BR><BR> <BR>

<HR id=stopSpelling>
<BR>
From: jay<BR>To: hosking<BR>CC: m3devel<BR>Subject: RE: [M3devel] how to switch between user and kernel threads..<BR>Date: Wed, 14 Jan 2009 21:30:59 +0000<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
I'll wait.<BR>So, build two different m3core.lib/a/so/dylib?<BR>m3core and m3coreuserthreads<BR> <BR>Compile both thread directories, if the platform supports it, and<BR>call quake make_lib twice with slightly different parameters?<BR>An m3core specific hack in the config file or cm3?<BR>Easy enough in the config file.<BR>Very m3core specific.<BR>I suppose you could argue that quake isn't a generic build system,<BR>but it is Modula-3's build system, and that m3core is really special.<BR> <BR>The result btw, would likely be no change at all to any *.i3 or *.m3 file.<BR> <BR>I still think function pointers are the way to go.<BR>Even with function pointers, the changes to *.i3 and *.m3 would be very minor.<BR>Just the export list would vary.<BR>And new *.i3 files introduced.<BR> <BR> - Jay<BR><BR><BR><BR>

<HR id=EC_stopSpelling>
<BR>
<BR>From: hosking<BR>To: jay<BR>Date: Wed, 14 Jan 2009 21:31:22 +1100<BR>CC: m3deve<BR>Subject: Re: [M3devel] how to switch between user and kernel threads..<BR><BR>I don't want dynamic switching.  A link-time switch is just fine.<BR><BR>
<DIV><BR></DIV>
<DIV>Also, please don't go messing about with this right now -- I have changes pending for the threads system that will be harder to integrate if you change with it further. 
<DIV>
<DIV><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<DIV style="WORD-WRAP: break-word"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate"><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<DIV><BR></DIV></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></SPAN></DIV>
<DIV>
<DIV>On 14 Jan 2009, at 20:14, Jay wrote:</DIV><BR class=EC_EC_Apple-interchange-newline>
<BLOCKQUOTE><SPAN class=EC_EC_Apple-style-span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<DIV class=EC_EC_hmmessage style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Are people really against using function pointers for this?<BR>Either changing the interface to have function pointer variables (I'm not sure Modula-3 allows this, but in C you can fairly transparently replace functions with function pointers; client code just keeps working; it breaks down in C++ with overloading), or having a set of functions that just call/jump through function pointers? There would be no if, no conditional branches.<BR> <BR>Dynamic linking on Windows always goes through function pointers already.<BR> So while yes it adds another instruction, it is already never getting inlined.<BR>Don't other platforms do that too?<BR>Or they patch every call site?<BR> <BR>I'm not sure otherwise of a simple method.<BR>Easiest might be to have a parallel directory structure to m3core, with just m3core files.<BR>That would wastefully rebuild all of m3core a second time, for just a small amount of variation.<BR> <BR>I think function pointers are the way to go here.<BR> <BR> - Jay</DIV></SPAN></BLOCKQUOTE></DIV></DIV></DIV></body>
</html>