From kde-devel Sun Oct 14 18:06:49 2007 From: Thiago Macieira Date: Sun, 14 Oct 2007 18:06:49 +0000 To: kde-devel Subject: Re: KIO::listDir() freezes in multi-threaded KioFuse due to timer Message-Id: <200710142007.10197.thiago () kde ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=119238531527435 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0212743924==" --===============0212743924== Content-Type: multipart/signed; boundary="nextPart4263367.3Fxik5kXiQ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart4263367.3Fxik5kXiQ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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=3Drev&revision=3D632925). > >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=20 progress, it can ask for passwords, etc. Saying KIO is GUI-less is=20 incorrect. And I think that trying to separate things would just be too=20 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=20 efforts to write thread-safe code do not change the fact that most of its=20 code dates from KDE 2.0 times and has been patched by several different=20 contributors for 7 years without thinking of thread-safety. So, the solution is simple: use the thread that contains QCoreApplication=20 only. (That's the GUI thread if there's a GUI) =2D-=20 =A0 Thiago Macieira =A0- =A0thiago (AT) macieira.info - thiago (AT) kde.org =A0 =A0 PGP/GPG: 0x6EF45358; fingerprint: =A0 =A0 E067 918B B660 DBD1 105C =A0966C 33F5 F005 6EF4 5358 --nextPart4263367.3Fxik5kXiQ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHElq5M/XwBW70U1gRAobbAJ9lB9G8LHZONXq9DFz9htCdr7Wl0QCgr0bY ni4wrDWuPXCDdiFKX1jCxYE= =vjfV -----END PGP SIGNATURE----- --nextPart4263367.3Fxik5kXiQ-- --===============0212743924== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0212743924==--