Account: Computers (pro@mu.zaitcev.nu)'s status on Thursday, 08-Aug-2024 02:51:24 JST
-
Embed this notice
@sun @thendrix One of the odd things many apps expect is for the child to run first out of fork().
It always annoyed me from the standpoint of a mini-micro-unix emulation on something like 8080. Because of that nonsense you must have to have 2 processes runnable, because the parent will need to reach wait() eventually. It's not a problem on a normal computer, because you just COW everything anyway. Your fork() is actually clone() with parameters. Just a few more page faults. On the original PDP-11, fork() was a swap and un-swap, so the disk's DMA did the job of memcpy(), so that's the historic reason why.
How apps sense which one runs first is by racing it with writing into signalling pipes. Which is just stupid and bugs, bugs all around.