21 messages in org.ruby-lang.ruby-talkRe: C Threads and Ruby| From | Sent On | Attachments |
|---|---|---|
| Kroeger, Simon (ext) | 20 Jun 2006 03:27 | |
| Patrick Hurley | 20 Jun 2006 04:28 | |
| Kroeger, Simon (ext) | 20 Jun 2006 04:59 | |
| Francis Cianfrocca | 20 Jun 2006 05:13 | |
| Patrick Hurley | 20 Jun 2006 09:39 | |
| Paul Brannan | 20 Jun 2006 11:33 | |
| Patrick Hurley | 20 Jun 2006 13:16 | |
| Francis Cianfrocca | 20 Jun 2006 13:17 | |
| Francis Cianfrocca | 20 Jun 2006 13:19 | |
| Simon Kröger | 20 Jun 2006 14:29 | |
| Joel VanderWerf | 20 Jun 2006 14:35 | |
| Francis Cianfrocca | 20 Jun 2006 14:39 | |
| Bill Kelly | 20 Jun 2006 14:42 | |
| Simon Kröger | 20 Jun 2006 14:49 | |
| Francis Cianfrocca | 20 Jun 2006 15:26 | |
| Francis Cianfrocca | 20 Jun 2006 15:34 | |
| Bill Kelly | 20 Jun 2006 16:08 | |
| Francis Cianfrocca | 20 Jun 2006 17:07 | |
| Kroeger, Simon (ext) | 21 Jun 2006 02:53 | |
| Francis Cianfrocca | 21 Jun 2006 03:15 | |
| Paul Brannan | 22 Jun 2006 08:21 |
| Subject: | Re: C Threads and Ruby![]() |
|---|---|
| From: | Paul Brannan (pbra...@atdesk.com) |
| Date: | 06/22/2006 08:21:53 AM |
| List: | org.ruby-lang.ruby-talk |
On Wed, Jun 21, 2006 at 05:17:15AM +0900, Patrick Hurley wrote:
against a Win32 API that required the use of threads. Now I am curious about TRAP_BEG/TRAP_END. Is it safe to access rb_XXX methods from inside a TRAP_BEG/TRAP_END block not in the ruby interpreter thread? If so that would make some things much easier.
What goes between TRAP_BEG/TRAP_END should be something that returns in the event of a signal (such as SIGVTALRM, which ruby uses to know when to switch threads). Usually system calls will return an error code and set errno to EINTR. The system call must later be restarted when control returns to the thread.
I don't believe most rb_XXX methods have this behavior, so you won't get the magic thread switching you get with system calls.
Paul




