[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Web services and Ruby

Luke A. Kanies

5/20/2005 5:12:00 PM

17 Answers

Sam Roberts

5/20/2005 7:18:00 PM

0

Wrote Luke Kanies <luke@madstop.com>, on Sat, May 21, 2005 at 02:12:28AM +0900:
> Can anyone recommend anything I can use to get this kind of behaviour?
> Are threads the only answer? (Please say they aren't.)

Whats wrong with threads? Its a good answer.

Taking a guess, in case you are worried, they aren't real threads, its
just a very nice wrapper around select().

Cheers,
Sam

--
http://www.ce...


Luke A. Kanies

5/20/2005 7:57:00 PM

0

Robert Klemme

5/20/2005 8:35:00 PM

0


"Luke Kanies" <luke@madstop.com> schrieb im Newsbeitrag
news:Pine.GSO.4.60.0505201455550.20592@kirby.madstop.com...
> On Sat, 21 May 2005, Sam Roberts wrote:
>
>> Whats wrong with threads? Its a good answer.
>
> Well, there are at least two problems with threads: I've never done them
> before and I hope not to have to learn them just to do this relatively
> simple piece, and second they do add another dimension of complexity, one
> which I must always be at least somewhat aware. Given that, as I
> mentioned, I'm a newbie to threads, this does not fill me with confidence.

Yeah, but

- there's quite some resources out there to learn from

- you will have to at some point in time

- but most important so: your application won't work without concurrency on
your nodes; it's an application requirement. It doesn't matter whether you
do that with threads or processes, you need the concurrency. And
concurrency always needs some form of synchronization. I'd say Ruby threads
and synchronization are easier to learn that what different OS provide in
terms of semaphores, locks, mutexes etc. And once you get the basic
concepts it's probably not that difficult to transfer that to some other
implementation / technology.

>> Taking a guess, in case you are worried, they aren't real threads, its
>> just a very nice wrapper around select().
>
> Yah, I know that they aren't real threads, but I believe they still come
> with some of the problems that I would have with real threads.

Like you having to learn them?

Kind regards

robert

Luke A. Kanies

5/20/2005 9:37:00 PM

0

Ara.T.Howard

5/20/2005 9:47:00 PM

0

Luke A. Kanies

5/20/2005 10:04:00 PM

0

Sam Roberts

5/20/2005 10:07:00 PM

0

Quoting luke@madstop.com, on Sat, May 21, 2005 at 04:57:29AM +0900:
> On Sat, 21 May 2005, Sam Roberts wrote:
>
> >Whats wrong with threads? Its a good answer.
>
> Well, there are at least two problems with threads: I've never done them
> before and I hope not to have to learn them just to do this relatively
> simple piece, and second they do add another dimension of complexity, one
> which I must always be at least somewhat aware. Given that, as I
> mentioned, I'm a newbie to threads, this does not fill me with confidence.

I was worried about threads, too, then I found they are trivial. You'll
just need two, I guess, and the data thats shared between them should
all be one place (good design), and you just wrap that with a Mutex.

If really should be easy.

> >Taking a guess, in case you are worried, they aren't real threads, its
> >just a very nice wrapper around select().
>
> Yah, I know that they aren't real threads, but I believe they still come
> with some of the problems that I would have with real threads.

Yeah, but doing things other ways has problems, too, and this way is
well supported in ruby.

Have fun,
Sam



Ara.T.Howard

5/20/2005 10:10:00 PM

0

Graham Foster

5/20/2005 10:29:00 PM

0

20/05/2005 23:11:47
"Ara.T.Howard" <Ara.T.Howard@noaa.gov> wrote in message
>
> the update of dirwatch should be out next week sometime.
This is very interesting... The code is pure Ruby - would this work
on a Windows environment too?
Graham

Ara.T.Howard

5/20/2005 11:01:00 PM

0