On Tue, Feb 14, 2017 at 5:05 PM, Darren Duncan <dar...@darrenduncan.net> wrote:
> On 2017-02-14 4:46 PM, Richard Hipp wrote: > >> <rant> This is yet another reason why I say "threads are evil". For >> whatever reason, programmers today think that "goto" and pointers and >> assert() are the causes of all errors, but threads are cool and >> healthful. Entire programming languages are invited (I'm thinking of >> Java) to make goto and pointers impossible or to make assert() >> impossible (Go) and yet at the same time encourage people to use >> threads. It boggles the mind.... </rant> >> > > There is nothing inherently wrong with threads in principle, just in how > some people implement them. Multi-core and multi-CPU hardware is normal > these days and is even more the future. Being multi-threaded is necessary > to properly utilize the hardware, or else we're just running on a single > core and letting the others go idle. The real problem is about properly > managing memory. Also giving sufficient hints to the programming language > so that it can implicitly parallelize operations. For example, want to > filter or map or reduce a relation and have 2 cores, have one core evaluate > half the tuples and another evaluate the other half, and this can be > implicit simply by declaring the operation associative and commutative and > lacking of side-effects or whatever. I'm with Dr Hipp - threads are evil. It's not so much how they work when everything goes well, it's that it's so challenging to align everything so that it goes well. My experience is that even very talented programmers write bugs into their multi-threaded code without realizing it. I think what happens is that multi-threaded code often makes things much more complicated than they look, so if you write to the limits of the complexity you can understand, you're already over your head. IMHO, if you're using a message-passing system which does implicit parallelization, well, _you're_ not using threads, the implementation is using threads on your behalf. That I can get behind. Unfortunately, decent systems along those lines are like nuclear fusion, they've been just around the corner for decades, now :-). -scott _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users