> > Andre spaketh: > > Personally, I think that adding this to QThread is not really needed > > though. I don't see what is wrong with setting the sleep period in > > milliseconds; sleep() should not be used all that much anyway. >
Craig respondeth: > In the same way that no-one will ever need more than 640k RAM ;) > I agree with Andre on this: sleep() shouldn't really be used for most designs. I also was "annoyed and confused" that I couldn't merely sleep() when I wanted. However, after much work, I came to understand it is protected for a reason: The best designs don't sleep() at all. We rewrote all our stuff, and now we never sleep(). Going forward, I similarly don't intend to sleep(). I know there may be "exceptional things" that may require it, but IMHO it's generally a good idea to work extra-hard to never sleep(). Yes, this typically means a re-design. But as Robin Burchell already pointed out, a merge request from David Faure > has already been accepted a few weeks ago which makes these three > sleep-related functions public statics of QThread (ie option (1) of my > original post). > Understood, I don't oppose this, but IMHO a "warning" in the documentation is a good idea to say, "Use of sleep() considered harmful". Most especially with signals/slots where we have very simple cross-thread synchronization and notification, there are a huge number of design options that do not require sleep() (which obsolete the concept of sleep()). My $0.02. --charley
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
