[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

waking up a Ruby thread asynchronously?

From: Joshua Haberman <joshua@...>
Date: 2006-01-29 21:27:45 UTC
List: ruby-core #7243
I am writing a C extension for Ruby that wraps a networking API.  I  
want to be able to write a Ruby function that blocks the calling Ruby  
thread until I get an asynchronous notification from the networking  
API that a message has arrived.  To do that, I would need a few extra  
hooks into the thread scheduler in eval.c. The main one would be:

/* can be called asynchronously (in a different thread from the
  * Ruby interpreter) */
rb_thread_async_wakeup(VALUE thread)
{
	rb_thread_check(thread)->status = THREAD_RUNNABLE;
}

This should cause the thread scheduler to consider this thread for  
running, the next time the scheduler runs.

What do you think?  Could such a hook be integrated into the main  
Ruby distribution?

Thanks,
Josh

In This Thread

Prev Next