<HTML><HEAD>
<META http-equiv=Content-Type content='text/html; charset=windows-1252'>
<title>Samsung Enterprise Portal mySingle</title>
<style> P, td, li {font-family:Arial, arial; font-size:9pt; margin-top:5px;margin-bottom:5px;} body{font-family:Arial, arial; font-size:9pt;}</style>
</HEAD><BODY><p> Hi,</p>
<p> </p>
<p>Keeping connection across fork is too much hassle and not worth the effort.</p>
<p>No doubt about it. it violates the rule of thumb 'make it simple but
not too simple'..</p>
<p>let the forked child process able to re-run dbus_g_bus_get.</p>
<p> </p>
<p>it is sufficient to have a simple API like 'dbus_g_connection_half_close'
(half closed connection from TCP definition).</p>
<p>It should be the api works and used just like fclose(fd) on unix pipe or
domain socket which must be closed when forked.</p>
<p> </p>
<p>of course.. It will be broken in Windows Socket implemetation.</p>
<p> </p>
<p> </p>
<p>Sean</p>
<p>Samsung</p>
<p> </p><br><br>------- <b>Original Message</b> -------<br><b>Sender</b> : Thiago Macieira<thiago@kde.org><br><b>Date</b> : 2007-04-06 01:53<br><b>Title</b> : Re: dbus fork problem<br><br>Havoc Pennington wrote:
<br>>Hi,
<br>>
<br>>Even in theory I'm not sure how a connection kept across fork() would
<br>>work... the behavior would be tough to define.
<br>>
<br>>If you can spec out what you need then we can discuss the API.
<br>
<br>I propose we don't do anything about it. If the application must do fork()
<br>and both processes have working connections, at least one of the
<br>connections should be a private one. And the connection used in the child
<br>process should be opened only after forking.
<br>
<br>The reason for that is that any other solution would probably break
<br>states: suddenly a plugin or library finds itself in a new connection
<br>(with a new unique name and without its well-known names).
<br>
<br>To properly handle this case, libdbus would need an entry point to be
<br>told "we have forked", so that it can close the connections and reopen
<br>them (might fail!!), then call back to the binding code with such
<br>information. And the bindings must propagate the information down to user
<br>code.
<br>
<br>In all, not worth it IMHO.
<br>
<br>--
<br> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
<br> PGP/GPG: 0x6EF45358; fingerprint:
<br> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
<br></BODY></HTML>