[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Promises that force themselves

On 02/07/2013 08:37 PM, Alex Shinn wrote:

> We have to be careful of everything in a multithreaded environment.
> The current assumption and existing implementation practice is that
> you need mutex locks for most data-structures.  People tend to
> get passionate about this and insist that certain data-structures must
> be implicitly thread-safe (notably hash-tables, but everyone draws the
> line differently).

In the Java world people moved away from that: The initial JDK 1.0
utility classes (like Vector and Hashtable) had all the methods
synchronized.  More recent thinking is that that is a performance
loser and provides a false sense of correctness: If your program
is single-threaded, then using a mutex is wasteful; if it is
multi-threaded then you almost certainly need to synchronize
based on the actual semantics of your program, and the synchronizing
done in a general-purpose library is unlikely to be sufficient.
	--Per Bothner
per@x   http://per.bothner.com/

Scheme-reports mailing list