diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2012-05-24 23:08:09 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2012-05-24 23:08:09 +0200 |
commit | 2910b7c5b1d55bc304344b584a25ea571a9075fb (patch) | |
tree | bfbfbc98d4c0e205d2726fa44170a16e8421855e /glibc/fork.mdwn | |
parent | 35b719f54c96778f571984065579625bc9f15bf5 (diff) |
Prepare toolchain/logs/master branch.
Diffstat (limited to 'glibc/fork.mdwn')
-rw-r--r-- | glibc/fork.mdwn | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/glibc/fork.mdwn b/glibc/fork.mdwn deleted file mode 100644 index 12ca2d19..00000000 --- a/glibc/fork.mdwn +++ /dev/null @@ -1,69 +0,0 @@ -[[!meta copyright="Copyright © 2010, 2011 Free Software Foundation, Inc."]] - -[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable -id="license" text="Permission is granted to copy, distribute and/or modify this -document under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no Invariant -Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled [[GNU Free Documentation -License|/fdl]]."]]"""]] - -On [[Unix]] systems, `fork` is a rather simple [[system call]]. - -Our implementation in [[glibc]] is and needs to be rather bulky. - -For example, it has to duplicate all port rights for the new [[Mach -task|microkernel/mach/task]]. The address space can simply be duplicated by -standard means of the [[microkernel/Mach]], but as [[unix/file_descriptor]]s -(for example) are a concept that is implemented inside [[glibc]] (based on -[[Mach port|microkernel/mach/port]]s), these have to be duplicated from -userspace, which requires a small number of [[RPC]]s for each of them, and in -the sum, [[this affects performance|open_issues/performance/fork]] when new -processes are continuously being spawned from the shell, for example. - -Often, a `fork` call will eventually be followed by an `exec`, which [[may in -turn close|open_issues/secure_file_descriptor_handling]] (most of) the -duplicated port rights. Unfortunately, this cannot be known at the time the -`fork` executing, so in order to optimize this, the code calling `fork` has to -be modified instead, and the `fork`, `exec` combo be replaced by a -`posix_spawn` call, for example, to avoid this work of duplicating each port -right, then closing each again. - -As far as we know, Cygwin has the same problem of `fork` being a nontrivial -operation. Perhaps we can learn from what they're been doing? Also, perhaps -they have patches for software packages, to avoid using `fork` followed by -`exec`, for example. - - -# TODO - - * [[fork: mach_port_mod_refs: - EKERN_UREFS_OWERFLOW|open_issues/fork_mach_port_mod_refs_ekern_urefs_owerflow]] - ([[!taglink open_issue_glibc]]). - - * Include de-duplicate information from elsewhere: [[hurd-paper]], - [[hurd-talk]], [[hurd/ng/trivialconfinementvsconstructorvsfork]], - [[open_issues/resource_management_problems/zalloc_panics]] ([[!taglink - open_issue_glibc open_issue_documentation]]). - - * We no longer support `MACH_IPC_COMPAT`, thus we can get rid of the `err = - __mach_port_allocate_name ([...]); if (err == KERN_NAME_EXISTS)` code - ([[!taglink open_issue_glibc]]). - - * Can we/why can't we use the concept of *inherited ports - array*s/`mach_ports_register` ([[!taglink open_issue_glibc]])? - - * GNUnet `vfork` signal race issue: [[!message-id - "87r50ww6m4.fsf@kepler.schwinge.homeip.net"]]. - - -## Related - - * [[open_issues/secure_file_descriptor_handling]]. - - -# External - - * {{$unix#djb_self-pipe}}. - - * {{$unix#rjk_fork}}. |