hi!
> -----Original Message-----
> From: Luc Vanlerberghe [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 30, 2001 10:26 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Thread-safety
>
>
> There are IMHO two reasons why these statements may be
> 'executed' out of
> order:
> [...]
tis is all very reasonable.
> To summarize:
> The designers of the JVM spec relaxed the requirements on order of
> execution to allow as much performance as possible while still
> guaranteeing the outcome of a program *if it is run in a
> single thread*
what irritates me here is the point that they should not have taken into
consideration what happens to multithreaded programs. this is because as
far as i understand support for multithreaded applications is one of the
core features of the java language.
> (I believe the word is 'deterministic').
> Whenever there's communication between threads, the programmer must be
> *very* careful to ensure that the state seen by one thread corresponds
> to the one written by another.
> AFAIK the only mechanism the Java language provides to ensure this is
> the use of synchronized blocks.
ironically the optimization which was implemented for performance
improvement does lead to a performance loss (because the locking of objects
is costly) in another place. of course, overall this could still be an
improvement - especially if most of the code executes "single threaded"...
regards
robert
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]