Stupid question
Stupid question
Posted Feb 16, 2007 19:47 UTC (Fri) by spitzak (guest, #4593)Parent article: Alternatives to fibrils
In both cases the system call is done by the parent process and the return is the child process. Why can't this be done the other way around, where the asyncrhonous call is being done by the child and it returns immediately to the parent? That would make a lot more sense, so I assumme there is a sensible reason that I can't figure out for how they are doing this.
Posted Feb 17, 2007 2:05 UTC (Sat)
by ds2horner (subscriber, #13438)
[Link] (2 responses)
Linus:
Posted Feb 20, 2007 0:28 UTC (Tue)
by mikov (guest, #33179)
[Link] (1 responses)
To me this seems completely unacceptable. Am I missing something ?
Posted Feb 22, 2007 21:02 UTC (Thu)
by huaz (guest, #10168)
[Link]
In his explanation it was so that the fork code could be reused with no modifications. He implies it could be done if it matters to callers.Stupid question - that Linus anticipated
Now, I agree that this is a bit ugly in some of the details: in
particular, it means that if the system call blocks, we will literally
return as a *different* thread to user space. If you care, you shouldn't
use this interface, or come up with some way to make it work nicely (doing
it this way meant that I could just re-use all the clone/fork code as-is).
How could it _not_ matter to callers ? If the thread id can change arbitrarily based on factors outside of the applications control - e.g. if some driver buffer is empty - then the thread id becomes completely pointless.Stupid question - that Linus anticipated
You are right, it's indeed unacceptable.Stupid question - that Linus anticipated
