ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/AnyEvent-Fork/Fork.pm
(Generate patch)

Comparing cvsroot/AnyEvent-Fork/Fork.pm (file contents):
Revision 1.25 by root, Sat Apr 6 08:55:16 2013 UTC vs.
Revision 1.26 by root, Sat Apr 6 08:58:51 2013 UTC

124For example, when a program uses an event loop and creates watchers it 124For example, when a program uses an event loop and creates watchers it
125becomes very hard to use the event loop from a child program, as the 125becomes very hard to use the event loop from a child program, as the
126watchers already exist but are only meaningful in the parent. Worse, a 126watchers already exist but are only meaningful in the parent. Worse, a
127module might want to use such a module, not knowing whether another module 127module might want to use such a module, not knowing whether another module
128or the main program also does, leading to problems. 128or the main program also does, leading to problems.
129
130Apart from event loops, graphical toolkits also commonly fall into the
131"unsafe module" category, or just about anything that communicates with
132the external world, such as network libraries and file I/O modules, which
133usually don't like being copied and then allowed to continue in two
134processes.
129 135
130With this module only the main program is allowed to create new processes 136With this module only the main program is allowed to create new processes
131by forking (because only the main program can know when it is still safe 137by forking (because only the main program can know when it is still safe
132to do so) - all other processes are created via fork+exec, which makes it 138to do so) - all other processes are created via fork+exec, which makes it
133possible to use modules such as event loops or window interfaces safely. 139possible to use modules such as event loops or window interfaces safely.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines