> On Feb 14, 2017, at 4:46 PM, Richard Hipp <d...@sqlite.org> wrote:
> 
> <rant> This is yet another reason why I say "threads are evil”.  

I agree, and it’s a pretty widely held opinion these days, going back at least 
to Edward Lee’s 2006 paper “The Problem With Threads”.[1] Actually the problem 
isn’t threads per se, but sharing mutable data between threads. There is a lot 
of work these days going into alternative concurrency mechanisms that are safer 
to use.

> 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.

Well, both Java and Go have pointers, including the dreaded null, just not 
pointer arithmetic or uninitialized pointers. And Go has had assertions for a 
while now. :)

One of the bad things about Java is that it made threads so easy to use that 
they became an “attractive nuisance” in the hands of inexperienced or careless 
programmers.
Go, to its credit, reintroduced the “channel” mechanism from CSP, a much safer 
way for threads to communicate. But channels are limited and somewhat slow, and 
Go still lets you mess with shared data and mutexes.

The really interesting work is going on in new languages like Rust and Pony 
that make it impossible to share mutable state between threads. They let you 
express the idea of moving data, so one thread can hand off state to another 
without copying.

—Jens

[1]: https://www2.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to