Another weird backtrace related to cover drawing

Mark Kretschmann kretschmann at kde.org
Thu Jul 24 07:59:13 CEST 2008


On 7/24/08, Daniel Winter <dw at danielwinter.de> wrote:
> On Wednesday 23 July 2008 08:33:42 Maximilian Kossick wrote:
>
>  > I think it's not a good idea. There's no reason to use querymaker in a
>  > synchronous manner in libamarok. Regarding scripting, is there any
>  > relevant scripting language that is not able to use callbacks?
>
>
> There are use cases for doing sync querys.  In a lot of cases were the actual
>  work is already done in some worker thread it is extra work to use the async
>  event driven QueryMaker without any benefits. Or even worse with extra overhead
>  of creating a new thread (not big but anyway) and the event handling.

Daniel is absolutely correct here. Doing queries in a worker thread is
a perfect use case for blocking (=synchronous) queries. In fact it's
the only sane way to use a blocking query, and one where it makes a
lot of sense.

Using a blocking query should only ever be done from a non-GUI thread,
and the blocking query should internally just wait() until the result
is there, but not do any event loop magic (which as we know can have
disastrous side effects).

We could make it so that it's technically impossible to use a blocking
query from the GUI thread. This could be achieved quite easily by
checking the caller's thread ID.

-- 
Mark Kretschmann
Amarok Developer
www.kde.org - amarok.kde.org


More information about the Amarok-devel mailing list