Out-of-memory error when using multiple threads
Havoc Pennington
hp at redhat.com
Sun Dec 30 16:59:41 PST 2007
Hi,
Olivier Hochreutiner wrote:
>> Is this the same as the "Phantom Out of Memory error" problem here:
>> http://lists.freedesktop.org/archives/dbus/2007-July/thread.html#8144
>
> Yes indeed, I didn't notice. Sorry for the dupe.
>
Researching all the old archives is not required, don't worry ;-)
>> Another lock is expensive and complex, it would be better to avoid it if
>> we can - the earlier thread has a few suggested alternatives.
>
> I looked at the thread of last July. One of your proposals is to just
> keep the connection lock when doing the callbacks, with the
> restriction that no dbus function using the connection can be called
> in the user code, or it would deadlock. I guess we could even get rid
> this restriction if the connection lock is made reentrant, but that
> would be risky I guess. I tried to just keep the lock and it does
> solve my problem, but it might break other bindings.
> So which solution among those detailed in the earlier thread would you
> recommend ? (that is, which one can I write a patch for ? ;)
Just keeping the lock is probably an improvement over what we have now,
so I'd take that patch.
The ideal fix is probably rearranging the code a lot more to call out to
the app in the right place (just before we'd be returning control to the
app, like the other _and_unlock() functions), but it's a pretty big
headache to do.
Havoc
More information about the dbus
mailing list