Hacker News new | ask | show | jobs
by pmoriarty 4234 days ago
"Most things are there, just done in very different ways."

Does it have something like the POSIX fork() system call? Apparently, its lack in Windows is the main thing that makes Cygwin as slow as it is.[1]

[1] - http://stackoverflow.com/questions/2512892/how-to-speed-up-c...

2 comments

Only UNIX clones support fork() properly, because only UNIX clones processes.

Any other non UNIX OS tends not to fully provide 100% fork() in they POSIX compatibility layer, or kind of fake it.

Sorry for the stupid question but does that mean you can't write C code in Windows that calls fork()?
I'm not really an expert but I'm pretty sure you can call fork but you will pay a full cost of a creating a new process, manually copying the memory state to the new process and parent and child have to do a complicated dance to ensure it all happens right. So it works and most of the semantics are the same, but it is god awful slow.
> you can call fork but you will pay a full cost of a creating a new process, manually copying the memory state to the new process and parent and child have to do a complicated dance to ensure it all happens right

That fork() and associated dance happens in cygwin1.dll or the equivalent POSIX compatibility library. Windows has no fork to call.

You are correct, fork() is part of the POSIX specification, Windows does not implement POSIX.