---------- Forwarded Message ---------- Subject: re: KThread Date: Fri, 1 Oct 1999 11:36:39 +0200 From: Lubos Lunak > Given the recent discussion about multi-threading the following might > be of interest: > > Request For Comments: KThread > > Why Threads? > ============ snip Hello, I just noticed the above message while browsing lists.kde.org ( too long with almost no Internet access, I have a lot of things to do :) ), and I'd like to ask you to forward this mail to kde-core-devel ( I don't have write access yet ) : Maybe some of you remember my mail about multithreading and Qt signals 3 months ago or so on kde-devel@ ( for some reason I can't find it at http://lists.kde.org ). Most of the replies were something like 'not portable enough', 'too difficult', and I was recommended not to use multithreading. For some reason this made me a bit angry *grin* and I started looking for a way how to make it possible to use threads with KDE. [ blah blah blah a lot of uninteresting stuff skipped ]. Now I have a library which is not far from being beta ( it's already quite usable I think ). The underlying library is Pthreads ( either native e.g. LinuxThreads or Pth ( its Pthreads wrappers ) for platforms which don't have any usable implementation ). I wanted to announce it next week, but when I saw this mail, I think now it's a good time. But since I'm now without my computer for this week, doing anything else than just saying 'I have something' is somewhat complicated. If you are interested in, try http://dforce.sh.cvut.cz/tsthreads.html and try your luck. There are instructions how to compile it on the www page, however, because it's done in a hyrry, maybe I forgot something. If you're lucky and compile it, look in the tests directory and try them out ( enable them in main.cpp ). A brief list of features : - completely C++ - stack-alocated instances are destroyed correctly when cancelling a thread - Qt signals which can be emitted in any thread and slots will be called in the main ( GUI ) thread, this way you GUI will ( ok, should ) never block - support for wrapping thread unsafe libraries, i.e. you'll be able to use such library simultaneously in several threads ( sometimes can be even transparent ) - can be quite easily used, I think that even someone with very little threads experience can use it to reduce GUI blocking ( some high-level classes like barriers, queues etc. so you maybe can do it without knowing what a mutex is ) - you can also use it in the 'event handling and messages sending' way - maybe some more interesting things I can't recall at the moment - and yes, there are some things that don't work yet the way I want, and some things that are not implemented yet at all ( but that can be fixed ) I repeat, if you download it now, you probably won't compile it, because I really didn't expect to announce it that soon, if it doesn't work for you, wait until Monday, I'll try to fix it during the weekend ( and also write a good example, all the tests in the tests directory are quite simple and stupid ). So, if you are interested, please let me know. Thank you .. and sorry for this mess. Lubos Lunak l.lunak@email.cz http://dforce.sh.cvut.cz/~seli May I introduce you my bugs ? -------------------------------------------------------