rreja2000 at yahoo.com
Thu Jun 5 01:56:51 EDT 2014
Why does the default implementation of Executors.newCachedThreadPool() has Integer.MAX_VALUE as the upper limit for number of threads?
If I use this default implementation, don't I risk creating a lot of threads when a burst of tasks gets scheduled and JVM running out of stack memory?
What is recommended?
On Thursday, June 5, 2014 1:52 AM, Vitaly Davidovich <vitalyd at gmail.com> wrote:
If you had multiple writers publishing a reference, lazySet won't work - you'd need a CAS loop (or locking, depending on expected contention/conflict rate).
Sent from my phone
On Jun 4, 2014 3:13 PM, "vikas" <vikas.vksingh at gmail.com> wrote:
>>On Fri, Nov 29, 2013 at 6:51 AM, Nitsan Wakart <[hidden email]> wrote:
>>>From my experience, lazySet is indeed your best choice (but only a valid
>choice for a single writer). You >>need a volatile read to match the HB
>relationship otherwise the compiler is free to optimize the value you
>>>read, so someone using your map in a loop may end up stuck if you don't do
> Why you said lazySet is a valid choice for single writer. Can you give
>any reference or example on what can go wrong with multiple writers.
>>> You hopefully meant StoreStore | LoadStore . Otherwise we have a very
>>> subtle but serious problem. >>(See
>>> *for a C++ discussion >>from a few years ago.)
> The link you provided is no more valid. Can you please provide the fresh
>View this message in context: http://jsr166-concurrency.10961.n7.nabble.com/Single-writer-multiple-readers-no-barriers-safe-tp10306p11048.html
>Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
>Concurrency-interest mailing list
>Concurrency-interest at cs.oswego.edu
Concurrency-interest mailing list
Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest