[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Running DRb in the main thread?

Laurent Julliard

12/17/2004 5:58:00 PM

I was wondering if there are some low level API that I can use in Drb
to make it run as the equivalent of an "event loop" in the main thread
of a program rather than having DRb starting its own thread as it does
when start_service is invoked.

The reason for this is that I need to run a remote program without
disturbing its original list of threads. So running "synchronously" in
the main thread would be ok.

Advices and ideas are welcome

Laurent


2 Answers

Eric Hodel

12/17/2004 6:06:00 PM

0

On 17 Dec 2004, at 09:58, Laurent Julliard wrote:

> I was wondering if there are some low level API that I can use in Drb
> to make it run as the equivalent of an "event loop" in the main thread
> of a program rather than having DRb starting its own thread as it does
> when start_service is invoked.
>
> The reason for this is that I need to run a remote program without
> disturbing its original list of threads. So running "synchronously" in
> the main thread would be ok.
>
> Advices and ideas are welcome

How about using ThreadGroup to organize your threads?

Laurent Julliard

12/17/2004 6:17:00 PM

0

Eric Hodel wrote:
> On 17 Dec 2004, at 09:58, Laurent Julliard wrote:
>
>> I was wondering if there are some low level API that I can use in Drb
>> to make it run as the equivalent of an "event loop" in the main thread
>> of a program rather than having DRb starting its own thread as it does
>> when start_service is invoked.
>>
>> The reason for this is that I need to run a remote program without
>> disturbing its original list of threads. So running "synchronously" in
>> the main thread would be ok.
>>
>> Advices and ideas are welcome
>
>
> How about using ThreadGroup to organize your threads?

It doesn't solve my problem because what I want is to avoid disturbing
the scheduling of the original threads.

I looked at the code and it looks like the only way I can do this is
by rewriting the main_loop method of drb/drb.rb in my own program.

Laurent