Threading example in FAQ 4.2 is slightly broken?


#1

Hi all,

I just ran the example at the end of FAQ 4.2

http://www.rubycentral.com/faq/rubyfaq-4.html#ss4.2

The FAQ text says this produces:

onetwo: : 00

onetwo: : 11

onetwo: : 33

This confused me, so I ran the code and got:

one: 0
two: 0
one: 1
two: 1
one: 3
two: 3

which made more sense. OK, so thread scheduling is nondetermininistic
and there’s no mutual exclusion on stdout, so I can see how the output
given in the FAQ entry could happen - however, I think the version I
saw demonstrates the FAQ’s point more clearly.

Who should I tell about this? Raise a bug? Or is raising the alarm
hereabouts sufficient? :slight_smile:

Thanks,

-Andy


#2

On 4/21/06, Andy G. removed_email_address@domain.invalid wrote:

one: 3
Thanks,

-Andy


Andy G.
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/

Hmm why don’t you drop a mail to the FAQ maintainer mailto:
removed_email_address@domain.invalid ?
Personally I fail to see the point of the example but that might just be
because I am tired.
Hope that helps
Robert

Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.

  • Albert Einstein

#3

Hi –

On Fri, 21 Apr 2006, Robert D. wrote:

onetwo: : 00
two: 1
Hmm why don’t you drop a mail to the FAQ maintainer mailto:
removed_email_address@domain.invalid ?

Actually the FAQ is now maintained at Ruby Garden:
http://www.rubygarden.org/faq. The old one, at rubycentral.com,
should connect you to the new one.

David


David A. Black (removed_email_address@domain.invalid)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

“Ruby for Rails” PDF now on sale! http://www.manning.com/black
Paper version coming in early May!


#4

On Fri, Apr 21, 2006 at 08:22:51PM +0900, removed_email_address@domain.invalid wrote:

You may be looking at the old FAQ. Have a look at:

http://www.rubygarden.org/faq/entry/show/24

I think that’s the one you mean, and it looks OK.

Aha. Yes indeed.

In that case, there are two issues:

  1. Googling for “ruby faq” gives the old version as the top hit.

  2. I didn’t get redirected to the new version from the old version.

I’ll let Dave T. know. Thanks. :slight_smile:

-Andy


#5

On 4/21/06, Andy G. removed_email_address@domain.invalid wrote:

In that case, there are two issues:

  1. Googling for “ruby faq” gives the old version as the top hit.

  2. I didn’t get redirected to the new version from the old version.

I’ll let Dave T. know. Thanks. :slight_smile:

-Andy

I think Hal F. is in charge of the FAQ now.

Curt


#6

Hi –

On Fri, 21 Apr 2006, Andy G. wrote:

onetwo: : 11
two: 3

which made more sense. OK, so thread scheduling is nondetermininistic
and there’s no mutual exclusion on stdout, so I can see how the output
given in the FAQ entry could happen - however, I think the version I
saw demonstrates the FAQ’s point more clearly.

Who should I tell about this? Raise a bug? Or is raising the alarm
hereabouts sufficient? :slight_smile:

You may be looking at the old FAQ. Have a look at:

http://www.rubygarden.org/faq/entry/show/24

I think that’s the one you mean, and it looks OK.

David


David A. Black (removed_email_address@domain.invalid)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

“Ruby for Rails” PDF now on sale! http://www.manning.com/black
Paper version coming in early May!


#7

On 4/21/06, Logan C. removed_email_address@domain.invalid wrote:

On Apr 21, 2006, at 8:53 AM, Curt H. wrote:

I think Hal F. is in charge of the FAQ now.

Curt

I believe Hal F. is in charge of the newsgroup/ML faq, not the
ruby faq.

There’s a newsgroup/ML faq? What’s the URL?


#8

On 4/22/06, John G. removed_email_address@domain.invalid wrote:

There’s a newsgroup/ML faq? What’s the URL?

Whoops. Sorry. I guess this:
http://rubyhacker.com/clrFAQ.html
is it.


#9

On Apr 21, 2006, at 8:53 AM, Curt H. wrote:

I think Hal F. is in charge of the FAQ now.

Curt

I believe Hal F. is in charge of the newsgroup/ML faq, not the
ruby faq.