Message139599
> - what would be the API of this atfork() mechanism (with an example of how it would be used in the library)?
The atfork API is defined in POSIX and Gregory P. Smith proposed a Python one above that we can look into.
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_atfork.html
We may need an API to reset a lock.
> - how do you find the correct order to acquire locks in the parent process?
One option is to use the import graph to determine call order of atfork handlers.
If a current std library does not fit into this scheme we can possibly fix it when writing its handlers.
> - what do you do with locks that can be held for arbitrarily long (e.g. I/O locks)?
It is likely that such a lock does not need acquiring at the parent, and re-initializing the library in the child handler will do.
A "critical section" lock that protects in-memory data should not be held for long. |
|
Date |
User |
Action |
Args |
2011-07-01 19:50:55 | nirai | set | recipients:
+ nirai, gregory.p.smith, pitrou, vstinner, bobbyi, neologix, Giovanni.Bajo, sdaoden, avian |
2011-07-01 19:50:55 | nirai | set | messageid: <1309549855.08.0.771144996469.issue6721@psf.upfronthosting.co.za> |
2011-07-01 19:50:54 | nirai | link | issue6721 messages |
2011-07-01 19:50:54 | nirai | create | |
|