<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
No.<BR>
I answered my question -- it is in case of really long pauses -- over 4billion milliseconds.<BR>
The waits are broken up into chunks of that size.<BR>
We use a 53bit? mantissa longreal to represent seconds whereas Win32 wait is 32bit number of milliseconds.<BR>
The one doesn't fit in the other.<BR>
<BR>
- Jay<BR> <BR>
<HR id=stopSpelling>
Subject: Re: [M3devel] win32 AlertPause polls instead of one big wait?<BR>From: hosking@cs.purdue.edu<BR>Date: Fri, 11 Dec 2009 10:06:03 -0500<BR>CC: m3devel@elegosoft.com<BR>To: jay.krell@cornell.edu<BR><BR><BASE>
<DIV><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="WORD-WRAP: break-word"><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV><SPAN style="FONT-SIZE: medium" class=ecxApple-style-span><FONT class=ecxApple-style-span color=#0000ff face="'Gill Sans'">Can you get spurious wakeups with those Windows calls?</FONT></SPAN></DIV></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></SPAN></SPAN></DIV><BR>
<DIV>
<DIV>On 11 Dec 2009, at 09:05, Jay K wrote:</DIV><BR class=ecxApple-interchange-newline>
<BLOCKQUOTE><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt" class=ecxhmmessage>Anyone know why Win32 AlertPause uses a polling loop instead of just one wait?<BR> <BR> <BR>I'm not sure this is going to work out, but:<BR> I'm "rewriting" stuff to use a separate event for alerting.<BR> alertable goes away<BR> There will be two events:<SPAN class=ecxApple-converted-space> </SPAN><BR> waitEvent, for condition variables<BR> alertEvent, for alerting<SPAN class=ecxApple-converted-space> </SPAN><BR> <BR> <BR>roughly speaking:<BR> <BR> <BR>AlertPause: WaitForSingleObject(alertEvent)<BR>AlertWait:<BR> alerted := WaitForMultipleObjects({alertEvent, waitEvent}) == WAIT_OBJECT_0)<BR>Alert(t): SetEvent(t.alertEvent);<BR>TestAlert: alerted := WaitForSingleObject(alertEvent, 0);<BR> <BR> <BR>It seems simple enough.<BR>That shows all the ingredients.<BR>That'll eliminate a lot of the global locking.<BR>And then one "last" iteration to use the Java code for condition variables and the global lock will be gone.<BR>You can't just use the Java code because it doesn't include alertability.<BR>You can't, I believe, draw a parallel to the pthreads code, because the Java code doesn't maintain a wait list with a mutex.<BR>The waiter/tickets/counter stuff is pretty clever -- I don't understand it yet..<BR> <BR> <BR> - Jay<BR></DIV></SPAN></BLOCKQUOTE></DIV><BR> </body>
</html>