RRWL with 'bad' Thread.getId() implementations

33 messages Options
RRWL with 'bad' Thread.getId() implementations – Hi All, While dealing with a customer issue, I ran in to the possibility of breaking a RRWL by feeding in Thread instances with colliding thre...
The JavaDoc for Thread.getId() says "...thread ID is unique..." so I don't think this is a bug in RRWL. Maybe Thread.getId() should b...
The issue about getId() not being final has been thrown about forever – it's not going to be fixed because it would cause too much breakage in us...
Wow! Final getId() would break user code? Interesting. Are there any examples? I can dream up a few but I am curious what is out in the wild...
Yeah, deprecate getId and introduce new final method sounds like a plan. On Jun 25, 2013 8:08 PM, "Nathan Reynolds" <nathan.reynolds...
Yes, sadly people will insist on hanging themselves whenever we give them enough rope. I don't think I've actually seen someones code that did t...
I have filed bug https://jbs.oracle.com/bugs/browse/JDK-8017617 for this. Nathan Reynolds <http://psr.us.oracle.com/wiki/index.php/User:Na...
I thought that Thread.getId() breaking RWLock was a known issue. That was one of the 1st observation I made years ago. The reliance on it was awk...
Speaking of modifying Thread class: Adding "public static Thread[] getAllThreads" would a welcome change. The functionally is availabl...
On 06/25/2013 07:33 PM, Nathan Reynolds wrote: > I have filed bug https://jbs.oracle.com/bugs/browse/JDK-8017617 for this. The public bug f...
On 06/25/2013 09:24 PM, Nathan Reynolds wrote: > The JavaDoc for Thread.getId() says "...thread ID is unique..." so I > don't th...
In a similar vein, the following code doesn't behave like you'd expect either (although it's arguable as to whether this is a reasonable way for ...
On 06/25/2013 11:54 PM, Chris Dennis wrote: > In a similar vein, the following code doesn't behave like you'd expect > either (although it...
(Sorry for mixing top and bottom posting - hope nobody is offended!) You'll need to blank the cachedHoldCounter when a thread releases it's la...
Right. In fact, it is specifically said: /** * [snip] * * <p>Can outlive the Thread for which it is...
WeakReference obviously, Like I've said: Thread.id is a cheap hack for == and weak reference. Alternative incl. eetop field. Stanimir On T...
On Tue, Jun 25, 2013 at 1:55 PM, Stanimir Simeonoff <stanimir@...>wrote: > WeakReference obviously, > Like I've said: Thread.id is...
On 06/26/2013 01:13 AM, Martin Buchholz wrote: > On Tue, Jun 25, 2013 at 1:55 PM, Stanimir Simeonoff > <stanimir@... <mailto:stanimi...
On Tue, Jun 25, 2013 at 2:16 PM, Aleksey Shipilev < aleksey.shipilev@...> wrote: > On 06/26/2013 01:13 AM, Martin Buchholz wrote: &g...
On 06/26/2013 01:20 AM, Martin Buchholz wrote: > > > > On Tue, Jun 25, 2013 at 2:16 PM, Aleksey Shipilev > <aleksey.ship...
On Wed, Jun 26, 2013 at 12:20 AM, Martin Buchholz <martinrb@...>wrote: > > > > On Tue, Jun 25, 2013 at 2:16 PM, Aleksey Sh...
On 25 Jun 2013, at 22:20, Martin Buchholz <martinrb@...> wrote: > On Tue, Jun 25, 2013 at 2:16 PM, Aleksey Shipilev <aleksey.ship...
Most people know that I consider acceding to requests to support per-thread read counts in JDK6 RRWL to be the worst decision I've ever made i...
On 06/25/13 19:03, Doug Lea wrote: > > We can and probably should fix this immediately by grabbing > the Thread's "tid" fi...
Aleksey Shipilev wrote: >>Now that's a good example! I think we don't actually need three threads in order to reproduce the bug. The follo...
There is special logic in place in RRWL (firstReader/firstReaderHoldCount) to optimize the uncontended read lock scenario, this is why you need t...
> public static final long getThreadId(Thread thread) { Doesn't it make more sense to have a member method instead of a static method? ...
Thenks! Now I see, my code with only two threads reproduces the bug for Oracle JDK1.6 implementation, but for JDK1.7 implementation one actually...
On 06/26/2013 02:43 PM, Doug Lea wrote: > On 06/25/13 19:03, Doug Lea wrote: >> We can and probably should fix this immediately by grab...
On 06/25/2013 11:32 PM, Aleksey Shipilev wrote: > On 06/26/2013 01:20 AM, Martin Buchholz wrote: >> >> >> On Tue, Jun 25,...
On 06/26/2013 01:03 AM, Doug Lea wrote: > The alternative of using a weak ref is not a good option. > The reason we use id's to begin with...
On 07/08/13 07:11, Peter Levart wrote: > On 06/26/2013 01:03 AM, Doug Lea wrote: >> The alternative of using a weak ref is not a good o...
Peter Levart wrote: >>I'm interested in the scenarios when an otherwise unreachable Thread >>object of a stopped thread could not be...