in reply to What is the difference between Windows fork an Unix fork ?
Windows has one primitive: CreateProcess, which is roughly equivalent to fork-then-exec.
cygwin works around this with crazy mad black magic1, which manages to emulate fork on windows (slowly). The perlfork doc linked above shows perl's own answer to that (presumably used in Activestate and Strawberry perl but not cygwin).
1: Something like: use CreateProcess to start a compliant, suspended process. Use setjmp to save state, parent copies text and data into waiting child (and setjmp info). Child starts and longjmp's back to saved state. Plus some more shenanigans with copying the stack and heap once the child is running. And probably a lot more. Amazing they ever got it working.
|
---|