> -----Original Message----- > From: Mrs. Brisby [mailto:[EMAIL PROTECTED] > Sent: Friday, July 22, 2005 3:07 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Multi-threading. > > > However the need for multi-threads is compelling. > Especially in a GUI > > environment. For instance a Mail reader. Where one thread > is needed > > to ensure the GUI is drawn correctly and respond to GUI events. > > Another to download and dispatch mail. (My Thunderbird has 10 > > threads. This may be a bit of overkill :) > > No. Threads are not a need. They allow you to use blocking > system calls in parallel without extra page table loads. > > History has demonstrated that programmers building > multithreaded applications tend to produce buggier code, and > code that touches more pages than a non-threaded version. As > a result, the non-threaded version is easier to write, safer, > and runs faster.
So, what's your point? That writing things the easy way leads to safer, less buggy, faster code? That's hardly a point. The original poster presented one of the more compelling reasons for multi-threading in modern apps, the GUI. It is hard, if not impossible, with modern GUI systems to write any relatively complex app that is both performant and graphically responsive without using threads. At least for the short term, Moore's Law is slowing down, we might as well start calling it Moore's Dream. All main CPUs are going multicore, even game consoles, and one of the only realistic ways to take advantage of that is through multi-threading. Saying it is hard doesn't change reality. > > > > As another user also mentioned, a Windows system works > better with few > > processes with many threads. > > Windows uses threads because x86 page tables are expensive to > load. It doesn't help: the system-call method Windows uses > eats any benefit that it has, again producing net-zero. This being THE reason Windows emphasizes threads over processes is hard to swallow. > > > I am also interested in your comments on Pointers and GoTo. I note > > that Java is 100% pointers. Apart from basic types, all > object access > > is by pointer. > > Java uses references, not pointers. This is purely semantic nit picking. > > > Using Exceptions correctly, I have never felt the need for a GoTo. > > Exceptions do the same as GoTo, accept, maybe, in a slightly more > > developed and useful way. > > Exceptions are slower than goto. They are also less > straightforward when deeply nested (long chains of throws XYZ > come to mind...) > I would agree that exceptions are not a good replacement for gotos. However, having been a professional C++ programmer for over 10 years, I have never needed a goto. This probably stems more from the fact that with C++/Java/C# you don't really need gotos, but with C/Basic/etc there are arguably things that you can't do, or would be quite hard to do, without gotos. > > These are just my opinions :) > > They are wrong. > I hope there was a hint of sarcasm in that last comment. The original poster obviously didn't hit everything on the nail, but there is a whole world of gray between right and wrong. Tim