[concurrency-interest] Pooled executor and data visibility

Lee, Phil Philip.Lee at logicacmg.com
Tue May 10 15:43:07 EDT 2005


David,

Thanks, that's very helpful. We're currently targeting JRE 1.4.2_06 and
I understand some of the JSR133 recommendation were incorporated into
pre-Java 5.0 releases but I have found it very difficult to find any
specific information. Any pointers would be much appreciated!

Cheers,

	Phil.

-----Original Message-----
From: David Holmes [mailto:dholmes at dltech.com.au] 
Sent: 10 May 2005 01:09
To: Lee, Phil; concurrency-interest at altair.cs.oswego.edu
Subject: RE: [concurrency-interest] Pooled executor and data visibility

Phil,

When thread-B acquires a monitor that was released by thread-A then ALL
writes performed by thread-A before releasing the monitor are visible to
thread-B when it acquires the monitor.

In terms of the memory-model, everything that happens-before the release
of a monitor in one thread, happens before a subsequent acquire of the
same monitor in another thread. This is spelt out in the Java Memory
Model spec which is in chapter 17 of the Java Language Specification,
3rd edition.

http://java.sun.com/docs/books/jls/index.html

Cheers,
David Holmes

> -----Original Message-----
> From: concurrency-interest-bounces at cs.oswego.edu
> [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Lee, 
> Phil
> Sent: Tuesday, 10 May 2005 12:32 AM
> To: concurrency-interest at altair.cs.oswego.edu
> Subject: [concurrency-interest] Pooled executor and data visibility
>
>
> Hi,
>
> I am using a PooledExecutor to handle events arriving for a large 
> number of session objects. If all Runnables passed to the 
> PooledExecutor invoke
> Session::work() then can I get away with just making Session::work() 
> synchronized to ensure that all data modifications are visibile to any

> other thread than handles a subsequent event for a that session. Put 
> another way, do the cache flush/invalidate effects of synchronized 
> extend to all data fields of all objects touched by calls made within 
> the synchronized block or are they limited to the object upon which 
> synchronized is operating. (I'm guessing it's the latter and hoping 
> it's the former but I haven't seen it spelt out anywhere :).
>
> TIA,
>
> 	Phil.
>
>
> This e-mail and any attachment is for authorised use by the intended 
> recipient(s) only. It may contain proprietary material, confidential 
> information and/or be subject to legal privilege. It should not be 
> copied, disclosed to, retained or used by, any other party. If you are

> not an intended recipient then please promptly delete this e-mail and 
> any attachment and all copies and inform the sender. Thank you.
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



More information about the Concurrency-interest mailing list