On 2017-02-14 5:05 PM, Darren Duncan 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. -- Darren
Duncan
Based on the responses I have seen, I think a lot of people have misunderstood
what I was trying to say here.
When I said "threads", I was meaning that term in the most generic sense
possible, in the same way that "concurrency" is generic. My saying
"multi-threaded" is saying to use appropriate tools, which come in a variety of
names, so that you permit your workload to be spread over multiple CPUs or CPU
cores at once, rather than constraining it to be run serially in a single core.
I was never advocating using a specific mechanism like a C language "thread".
-- Darren Duncan
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users