base::GlobalDescriptors should generate keys |
|||
Issue descriptionbase::GlobalDescriptors is used to share file descriptors when forking processes. So far, keys are hard-coded. Different modules using it have to agree on which range of these keys they use as to avoid collisions. This could be changed so that when registering a file descriptor, GlobalDescriptors generates the key itself and no hard-coding is required. (the key would have to be passed to the process, Mojo does that currently as a command line param)
,
Dec 22 2016
,
Jan 19 2017
Turns out this is a bit complicated because of the 2 ways a child-process can be started on Linux. In the Zygote case, we pass the (key, fd) pairs as part of an initial IPC message (which is used to populate GlobalDescriptors), so it would be straight-forward to also pass on the command line a module specific param specifying the key. The consumer code in the child process would then retrieve that key from the command line and use it to get the FD from the GlobalDescriptors. The non zygote case is more problematic. Right now, the code forks and then "shuffles" the registered FDs (so they can be at a specific spot, the actual key value, which is confusing). If the passed in keys and FDs are not static anymore, we'll need to pass the pairs (key, fd) to the child process so that after exec the child process can populate GlobalDescriptor. That would either require passing that info on the command line (at which point, do we have to worry about command line max length?), or send it through an IPC as done in the zygote case.
,
Aug 1
|
|||
►
Sign in to add a comment |
|||
Comment 1 by jcivelli@chromium.org
, Dec 21 2016