3 ms·
Fork doesnt make a lot of sense on win32 processes (how do you handle a forked message loop?) so the functionality isn't exposed, though nt native processes can
by nimish 10y ago
Fork doesnt make a lot of sense on win32 processes (how do you handle a forked message loop?) so the functionality isn't exposed, though nt native processes can do it. The best you can do is a spawn equivalent with manual copying of structures so you lose the CoW fork semantics that allow for speed on Unix.
For Linux subsystem processes fork works pretty well, but they are different animals
- quotemstr 10y ago> Fork doesnt make a lot of sense on win32 processes (how do you handle a forked message loop? Message loops are per-thread and per-HWND (which are thread-affine) anyway. One way of making fork "make sense" in win32 processes is to say "Okay, you can fork, but your new process begins execution in a new thread, and none of the old threads survive." New thread means new message loop. You could even do things like automatically tear down single-threaded COM apartments in the child process.