1
0
Fork 0
tractor/tractor
Tyler Goodlet f46d5b2b62 Hackery to override the stdlib's forkserver
The stdlib insists on creating multiple forkservers and semaphore trackers
for each sub-sub-process launched. This isn't ideal since it costs each
`tractor` sub-actor an additional 2 more processes then necessary and is
confusing when viewed as a process tree (eg. via `pstree`).

The majority of the change is simply avoiding the call to
`forkserver.ensure_running()` and `semaphore_tracker.ensure_running()`
in `ForkServer.connect_new_process()` and instead treating the user like
an adult and expecting those calls to be made *once* in the parent most
process (i.e. what `multiprocessing` calls the `MainProcess`).

Really a proper patch should be made against cpython which allows for
similar manual management of the server along with a mechanism to communicate
forkserver and semaphore tracker fd info to sub-processes such that
further calls to `Process.start()` work as expected.

Relates to #6
2018-08-04 18:15:24 -04:00
..
__init__.py Drop the "main" task via kwarg idea 2018-08-02 15:24:28 -04:00
_actor.py Drop needless if check 2018-08-04 18:10:31 -04:00
_forkserver_hackzorz.py Hackery to override the stdlib's forkserver 2018-08-04 18:15:24 -04:00
_ipc.py Use plain func for __aiter__() 2018-08-04 18:15:24 -04:00
_portal.py Drop the "main" task via kwarg idea 2018-08-02 15:24:28 -04:00
_state.py Reorg everything into private modules 2018-07-14 16:09:05 -04:00
_trionics.py Drop the "main" task via kwarg idea 2018-08-02 15:24:28 -04:00
log.py Reorg everything into private modules 2018-07-14 16:09:05 -04:00