2007/5/21, Havoc Pennington &lt;<a href="mailto:hp@redhat.com">hp@redhat.com</a>&gt;:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>Mikkel Kamstrup Erlandsen wrote:<br>&gt; Thanks. This is what we will do. I take it the way to do it is the way<br>&gt; Ross described by listening for NameOwnerChanged signals (at least it<br>&gt; works for me here).
<br><br>Right, NameOwnerChanged is what you want.<br><br>&gt; Allow me to sneak a related question into this thread... We need to<br>&gt; scale pretty good with regards to spawning searches. Fx ~50 searches<br>&gt; within one second could happen - will dbus be a bottle neck here if we
<br>&gt; choose to make Search objects real dbus objects (because we need to<br>&gt; register each one on the bus)?<br>&gt;<br>&gt; I assume that spawning a new object takes a round trip to the bus atleast...<br><br>Nope, object paths are kept in-process inside your app, the bus does not
<br>keep track of them.</blockquote><div><br>Hmmm, good to know. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The only single functions you can call in libdbus that do a round trip
<br>are the functions in dbus-bus.h that wrap a remote method call, and the<br>DBusConnection methods with _block() in the name. Otherwise, a round<br>trip will be something you can see in your code since you&#39;ll send a
<br>request, then later explicitly block for reply. The higher-level<br>bindings sometimes make it easier to inadvertently add round trips, though.<br><br>The only round trip you are requiring here is that if a search result is
<br>an object, the app has to do:<br>&nbsp;&nbsp;CreateSearch -&gt; search daemon<br>&nbsp;&nbsp;get back search object &lt;- search daemon<br>&nbsp;&nbsp;invoke method on search object -&gt; search daemon<br><br>If you want to avoid that round trip, you would need the app to create
<br>the search object path, instead of having the search daemon do it. For<br>example you could specify that the app will randomly generate a short<br>string mkstmp()-style and send it to the search daemon, and the search
<br>daemon will create an object path with that name (or throw an error if<br>the name exists already).<br><br>Xlib does pretty much exactly this; the X server allocates blocks of<br>resource IDs to connected clients, then the clients use those blocks to
<br>assign their own IDs to resources they create.<br><br>This is probably overoptimization in your case, but it is a useful<br>strategy to know.</blockquote><div><br>Ok. I don&#39;t think we need that optimization, but we haven&#39;t really got any benchmarks yet. Should be easy to test though...
<br></div><br></div>Thanks a bunch for the insight. Cheers,<br><br>Mikkel<br>