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

List:       kde-devel
Subject:    Re: threading in kde
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2001-09-09 20:29:06
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 07 September 2001 22:08, Andrew Sutton wrote: 
<snip> 
> > Qt is nowhere near completely thread safe and likely will stay that 
> > way for many years, perhaps for its lifetime. 
> 
> actually, if the qt folks would come out and say, "when writing a 
> multithreaded gui application, the gui will run in one thread and all 
> gui generated events will be handled in the same thread context" it 
> would be a nice place to start. that would eliminate any confusion in 
> what needs to be made thread safe. 
> 
> actually, i'm starting to think that it does work that way. 
<snip> 
 
It does. Read $QTDIR/doc/html/threads.html. 
 
The problem is more that the basic toolclasses (QString and QPtrList 
esp.) aren't thread-safe (for obvious performance reasons). The main 
problem is that they're implicitely shared. So you have to be very 
careful not to use them in different threads concurrently. 
 
But if we really restrict the use of threads to "one GUI and event 
thread and else only worker threads", it's quite obvious which objects 
need mutex protection - all the ones possibly accessed by the worker 
threads. If you keep the worker threads simple, so stay the locking 
issues and the overhead generated by that. 
 
Marc 
 
- --  
There is perhaps no better demonstration of the folly of human 
conceits than this distant image of our tiny world. 
   -- Carl Sagan 
      (on the image of Earth "a pale blue dot in a sunbeam" taken by 
       Voyager 1 from beyond the orbit of Neptune on 14 February 1990) 
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7m9ET3oWD+L2/6DgRAmH/AJ4pNHYk+Wj7DeUhWAyBVGOt+AyTHACgqsm4
LQrgcDcKu7ud5sU2CqcBMJU=
=QPvZ
-----END PGP SIGNATURE-----

Aÿÿÿÿÿ‚	ø 3A`a‡U
 
>> 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