<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Tony, can you..um, trick question sort of, briefly explain the differences between pthreads and Modula-3 threads?<br>The "trick" part is that, to an audience (me) who is not all that familiar with the nuances of either?<br>I'll see if I can find my green book and other reference material (online).<br><br><br>I understand the basics of threading very well, if that helps.<br>Eh, not much to it really.<br><br><br>I'm not super familiar with condition variables, as Win32 didn't historically have them.<br>But I think I understand them.<br><br><br>Specific questions:<br> Can Modula-3 threads be implemented more directly upon pthreads?<br><br><br> Why do we need to maintain a waiting list?<br><br><br> Is "alert" the same as "cancel" in pthread vocabulary? Or almost the same?<br><br><br> I understand..there might be a difficult problem..does Modula-3 allow catching an alert? I think so.<br> Does Posix allow canceling a cancel? I think not.<br><br><br> Posix allows, what I think of as try/finally, for alert. Modula-3 probably does too. Even though you can't stop the cancel, you can run "cleanup" code that runs before the cancel completes.<br><br><br>However mapping Modula-3 to Posix here would be tricky. As I see things..any function with a try/finally would have to be contorted into a form that passes a pointer to itself, along with parameters, to C code that does pthread_cleanup_push/pop around calling the function pointer. At least given the Darwin implementation. Other implementations might simply be able to call push at the start and pop at the end. But on Darwin these functions are macros where push introduces a local variable that pop references. I guess maybe one could to the "reverse engineering" approach (just by reading the header). But it'd still be ugly.<br><br><br>I have to do more research here.<br><br><br>I'm seriously consider "writing" a ThreadPThreadDirect.m3 that is thinner than the current ThreadPThread.m3 and see how it fairs, specifically if the Juno hangs go away.<br>"writing" being an exaggeration because it should be very small.<br><br><br>Thanks,<br> - Jay<br><br></body>
</html>