Project

General

Profile

Actions

Bug #9269

closed

class variable is not being handled correctly

Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
[ruby-core:59231]

Description

I was doing an experiment after discussing with Charles Nutter whether the memoize pattern (@v ||= value_processing) was atomic in MRI and found what seems to be a curious bug in MRI implementation:

https://gist.github.com/rosenfeld/8056742

Shouldn't the output be 1, 101, 102, 102 instead of 1, 1, 102, 102?

Also, should I post the code and output here or is it ok to just link to it? Also, if I were to paste the code here, how am I supposed to format Ruby code in this Redmine?

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Rejected

That code just starts threads but wait nothing.
Makes no sense.

Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 10 years ago

Why do you think so? This is not my understanding. Could you please explain why the threads are not joining? I still think this is a bug. Please consider reopening it.

Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 10 years ago

ah, sorry, I saw the comment on the gist. It doesn't notify me by e-mail.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0