Forum: Ruby Threading example in FAQ 4.2 is slightly broken?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andy G. (Guest)
on 2006-04-21 12:24
(Received via mailing list)
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?  :-)

Thanks,

-Andy
Robert D. (Guest)
on 2006-04-21 15:11
(Received via mailing list)
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
unknown (Guest)
on 2006-04-21 15:24
(Received via mailing list)
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!
unknown (Guest)
on 2006-04-21 15:24
(Received via mailing list)
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?  :-)

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!
Andy G. (Guest)
on 2006-04-21 15:33
(Received via mailing list)
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.  :-)

-Andy
Curt H. (Guest)
on 2006-04-21 16:53
(Received via mailing list)
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.  :-)
>
> -Andy


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

Curt
Logan C. (Guest)
on 2006-04-21 18:36
(Received via mailing list)
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.
John G. (Guest)
on 2006-04-23 03:46
(Received via mailing list)
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?
John G. (Guest)
on 2006-04-23 03:52
(Received via mailing list)
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.
This topic is locked and can not be replied to.