<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Ok, it looks like I did break it.<BR>
<BR>
<BR>
<A href="http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-libs/libm3/src/os/WIN32/ProcessWin32.m3.diff?r1=1.6;r2=1.7">http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-libs/libm3/src/os/WIN32/ProcessWin32.m3.diff?r1=1.6;r2=1.7</A><BR>
<BR>
<BR>
GetID used to return the handle. I changed it to return the id.<BR>
m3middle/Process.Abort LOOPHOLEs GetID to a handle.<BR>
I think the GetID change should probably stay. But certainly one or the other must change.<BR>
The handle is not unique across the system, just the process, whereas the id is unique across the system.<BR>
If Process.i3 only mandates within the process, then maybe the old way. Maybe.<BR>
<BR>
<BR>
- Jay<BR> <BR>
<HR id=stopSpelling>
From: jay.krell@cornell.edu<BR>To: mika@async.caltech.edu<BR>Date: Mon, 21 Feb 2011 03:28:10 +0000<BR>CC: m3devel@elegosoft.com<BR>Subject: Re: [M3devel] [M3commit] CVS Update: cm3<BR><BR>
<META name=Generator content="Microsoft SafeHTML">
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Wait? No, that is probably just bogus posix thinking.<BR>You can just close your handle to the process.<BR>You don't have to wait for it to exit.<BR> <BR> <BR>It is somewhat orthogonal.<BR>The thing is, the request for Process.Kill, got me looking at when<BR>does libm3 close the Process handle and when does it use the<BR>handle correctly (i.e. not m3middle's Process.Abort!)<BR>It does the CloseHandle in Process.Wait, so if that is never called, there is a leak.<BR> <BR> <BR>Anyway, this should be easy to make correct.<BR> (So easy, though, it boggles the mind as to why it was done this way<BR> in the first place. I do have to check somethig -- it is SLIGHTLY possible I broke it.<BR> I know I fiddled around with the definition of process ids, made them match<BR> the underlying platform. I'll check the history. m3middle uses a LOOPHOLE<BR> on some "id" to get the "handle". Anyway, I'll check and make it correct.)<BR> <BR><BR> - Jay<BR> <BR>> To: jay.krell@cornell.edu<BR>> Date: Sun, 20 Feb 2011 17:15:50 -0800<BR>> From: mika@async.caltech.edu<BR>> CC: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] [M3commit] CVS Update: cm3<BR>> <BR>> <BR>> Jay I didn't quite follow your previous messages. What is the correct<BR>> solution, and what did you mean when you were talking about the garbage<BR>> collector? It does seem like---if a Process handle goes out of scope<BR>> and gets collected then yes the runtime should do the equivalent of "EVAL<BR>> Process.Wait" at some future time. But that seems unrelated/orthogonal<BR>> to the issues with the Windows process killing...<BR>> <BR>> The process killing in m3middle/M3Process I think is only called in<BR>> a few places in the compiler and then under what already are dubious<BR>> circumstances. For instance I see it done where Process.Create has<BR>> failed. But if Process.Create has failed, then there's no process to<BR>> kill, so it all seems rather pointless. It is also called as one of<BR>> the last actions before exiting the parent process, so there's another<BR>> reason for its being pointless.<BR>> <BR>> In other words I think it's safe to say that if you have an idea for<BR>> how to implement process-killing correctly on Windows you can do it<BR>> however you like without fear of breaking any existing code...<BR>> <BR>> Mika<BR>> <BR>> But I can <BR>> <BR>> Jay K writes:<BR>> >--_d36c70d3-e71b-433d-abdc-06703a929f89_<BR>> >Content-Type: text/plain; charset="iso-8859-1"<BR>> >Content-Transfer-Encoding: quoted-printable<BR>> ><BR>> ><BR>> >The code here confuses hProcess and dwProcessId.<BR>> >Can we introduce a public function here in libm3 instead of m3middle?<BR>> >ie: to avoid answering the question as to how to expose hProcess?<BR>> >And to avoid the loophole as well?<BR>> ><BR>> >Thanks=2C<BR>> > - Jay<BR>> ><BR>> >From: jay.krell@cornell.edu<BR>> >To: jkrell@elego.de=3B m3commit@elegosoft.com<BR>> >Subject: RE: [M3commit] CVS Update: cm3<BR>> >Date: Mon=2C 21 Feb 2011 00:35:38 +0000<BR>> ><BR>> ><BR>> ><BR>> ><BR>> ><BR>> ><BR>> ><BR>> ><BR>> >Hm. Actually=2C Win32 is not broken=2C but libm3/m3middle are clearly incor=<BR>> >rect here.<BR>> ><BR>> > - Jay<BR>> ><BR>> >> Date: Mon=2C 21 Feb 2011 01:32:47 +0000<BR>> >> To: m3commit@elegosoft.com<BR>> >> From: jkrell@elego.de<BR>> >> Subject: [M3commit] CVS Update: cm3<BR>> >>=20<BR>> >> CVSROOT: /usr/cvs<BR>> >> Changes by: jkrell@birch. 11/02/21 01:32:47<BR>> >>=20<BR>> >> Modified files:<BR>> >> cm3/m3-sys/m3middle/src/: M3Process.i3=20<BR>> >>=20<BR>> >> Log message:<BR>> >> remove incorrect comments=3B Win32 is not broken<BR>> >>=20<BR>> > =<BR>> ><BR>> >--_d36c70d3-e71b-433d-abdc-06703a929f89_<BR>> >Content-Type: text/html; charset="iso-8859-1"<BR>> >Content-Transfer-Encoding: quoted-printable<BR>> ><BR>> ><html><BR>> ><head><BR>> ><style><!--<BR>> >.hmmessage P<BR>> >{<BR>> >margin:0px=3B<BR>> >padding:0px<BR>> >}<BR>> >body.hmmessage<BR>> >{<BR>> >font-size: 10pt=3B<BR>> >font-family:Tahoma<BR>> >}<BR>> >--></style><BR>> ></head><BR>> ><body class=3D'hmmessage'><BR>> >The code here confuses hProcess and dwProcessId.<br>Can we introduce a publ=<BR>> >ic function here in libm3 instead of m3middle?<br>ie: to avoid answering th=<BR>> >e question as to how to expose hProcess?<br>And to avoid the loophole as we=<BR>> >ll?<br><br>Thanks=2C<br> =3B- Jay<br><br><hr id=3D"stopSpelling">From: =<BR>> >jay.krell@cornell.edu<br>To: jkrell@elego.de=3B m3commit@elegosoft.com<br>S=<BR>> >ubject: RE: [M3commit] CVS Update: cm3<br>Date: Mon=2C 21 Feb 2011 00:35:38=<BR>> > +0000<br><br><BR>> ><BR>> ><meta http-equiv=3D"Content-Type" content=3D"text/html=3B charset=3Dunicode=<BR>> >"><BR>> ><meta name=3D"Generator" content=3D"Microsoft SafeHTML"><BR>> ><style><BR>> >.ExternalClass .ecxhmmessage P<BR>> >{padding:0px=3B}<BR>> >.ExternalClass body.ecxhmmessage<BR>> >{font-size:10pt=3Bfont-family:Tahoma=3B}<BR>> ><BR>> ></style><BR>> ><BR>> ><BR>> >Hm. Actually=2C Win32 is not broken=2C but libm3/m3middle are clearly incor=<BR>> >rect here.<br><br> =3B- Jay<br><br>>=3B Date: Mon=2C 21 Feb 2011 01:3=<BR>> >2:47 +0000<br>>=3B To: m3commit@elegosoft.com<br>>=3B From: jkrell@eleg=<BR>> >o.de<br>>=3B Subject: [M3commit] CVS Update: cm3<br>>=3B <br>>=3B CVS=<BR>> >ROOT: /usr/cvs<br>>=3B Changes by: jkrell@birch. 11/02/21 01:32:47<br>>=<BR>> >=3B <br>>=3B Modified files:<br>>=3B cm3/m3-sys/m3middle/src/: M3Proce=<BR>> >ss.i3 <br>>=3B <br>>=3B Log message:<br>>=3B remove incorrect commen=<BR>> >ts=3B Win32 is not broken<br>>=3B <br> </body><BR>> ></html>=<BR>> ><BR>> >--_d36c70d3-e71b-433d-abdc-06703a929f89_--<BR> </body>
</html>