Jafar & Clint,
I didn't realize fork wasn't implemented in Windows. Failure wasn't what I
expected.
And while a solution is the most desirable, documentation is also valuable.
I wonder how many other things fail when unimplemented and provide possibly
unexpected results. For instance in the IPL there's an example of fork code
like so:
if fork() = 0 then
write("child")
else {
delay(1000)
write("parent")
It fails into the parent code which could assume something happened. A runerr
would have been harder to ignore. How it fits into the general strategy of
such things is probably more important.
Thanks.
David
>________________________________
>From: Jafar Al-Gharaibeh <[email protected]>
>To: Clinton Jeffery <[email protected]>
>Cc: David Gamey <[email protected]>
>Sent: Saturday, October 29, 2011 2:42:55 PM
>Subject: Re: fork under windows?
>
>
>You are correct, Windows doesn't provide any function with the semantic of
>fork(). Probably relaying on spawn family on windows is the closet we can get
>to simulate a similar behavior of fork. I know we already use _spawnvp to
>launch external DOS commands. I will look for ideas out there and see if we
>can get an "acceptable" behavior.
>
>Jafar
>
>
>
>
>On Sat, Oct 29, 2011 at 11:16 AM, Clinton Jeffery <[email protected]>
>wrote:
>
>As far as I know, Windows does not provide an equivalent of fork() or
>primitives that would allow us to emulate it. Those windows environments that
>have a fork() are providing an entire OS emulation layer. But, please look
>into whether the situation has improved any with recent Windows versions and
>64-bit versions of the OS.
>>
>>
>>Clint
>>
>>
>>
>>On Sat, Oct 29, 2011 at 11:06 AM, Jafar Al-Gharaibeh <[email protected]>
>>wrote:
>>
>>David,
>>>
>>> Strangely enough, failing is the correct behavior! fork is not
>>>implemented under Windows. Below is a portion of the source code for fork().
>>>Not sure why it wasn't implemented in the first place. I will look into that
>>>and see how hard/portable to include it in the next release.
>>>
>>>Jafar
>>>
>>>
>>>#if NT
>>> fail;
>>>#else /* NT */
>>> if ((pid = fork()) < 0) {
>>> IntVal(amperErrno) = errno;
>>> fail;
>>> }
>>> return C_integer pid;
>>>#endif /* NT */
>>>
>>>
>>>
>>>
>>>
>>>
>>>On Sat, Oct 29, 2011 at 9:31 AM, David Gamey <[email protected]> wrote:
>>>
>>>Jafar,
>>>>
>>>>
>>>>Not sure where this is at. Fork fails under Windows 7/x64 running Unicon
>>>>Version 12.0. July 13, 2011.
>>>>
>>>>
>>>> if pid := fork() then
>>>> if pid ~= 0 then {
>>>> delay(1000)
>>>> write("This is the parent process - pid=",image(pid))
>>>> }
>>>> else
>>>> write("This is the child process - pid=",image(pid))
>>>> else write("Fork failed!")
>>>>
>>>>David
>>>
>>>
>>>--
>>>"Let there be no compulsion in religion: Truth stands out clear from error"
>>>[The Holy Qur'an 2:256]
>>>
>>>"Injustice anywhere is a threat to justice everywhere" Dr. King
>>>
>>
>
>
>--
>"Let there be no compulsion in religion: Truth stands out clear from error"
>[The Holy Qur'an 2:256]
>
>"Injustice anywhere is a threat to justice everywhere" Dr. King
>
>
>------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World™ now supports Android™ Apps
for the BlackBerry® PlayBook™. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group