[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KIO::listDir() freezes in multi-threaded KioFuse due to timer
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-10-14 18:06:49
Message-ID: 200710142007.10197.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Vlad Codrea wrote:
>This seems to be an artificial limitation, since KIO and the GUI don't
>have much in common. There are apps, like KioFuse, that need file
>access but not a GUI. I thought that separating the GUI and non-GUI
>parts of KIO would have gotten rid of the GUI-thread limitation
>(http://websvn.kde.org/?view=rev&revision=632925).
>
>I can modify KioFuse to use KIO from the main thread, but that will
>add complexity to the program. I wonder if it would be better for me
>to try to make KIO usable from non-GUI threads, especially since other
>apps might need this, too. Just to be clear, I'm not talking about
>making KIO threadsafe (ie. using the same ListJob instance in multiple
>threads), but simply being able to create/use a ListJob instance in a
>non-GUI worker thread. Do you think this is feasible and worthwhile?

KIO does GUI: it shows rename dialog boxes, download progress, delete 
progress, it can ask for passwords, etc. Saying KIO is GUI-less is 
incorrect. And I think that trying to separate things would just be too 
difficult and add unnecessary complexity.

KIO has been made for KDE applications. And KDE applications have a GUI.

What's more, KIO has not been written with thread-safety in mind. Recent 
efforts to write thread-safe code do not change the fact that most of its 
code dates from KDE 2.0 times and has been patched by several different 
contributors for 7 years without thinking of thread-safety.

So, the solution is simple: use the thread that contains QCoreApplication 
only. (That's the GUI thread if there's a GUI)

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic