Chris Shea wrote:
> C:\>test.rb C:\WINDOWS\system32\runonce.ex*
> [BUG] cross-thread violation on rb_gc()
> ruby 1.8.5 (2006-08-25) [i386-mswin32]

To my knowledge, a cross-thread violation occurs when a piece of code 
(which exists on a different *stack* altogether, i.e. running within a 
POSIX or native thread alongside the Ruby interpreter in the same 
process) makes use of Ruby's C language API.

I have encountered this when I was embedding a Ruby interpreter inside a 
C program. Ruby was running inside a POSIX thread and therefore had its 
own *stack*. When the C program made use of Ruby's C language API, the 
entire process would crash with that cross-thread violation error.

Here, you can see why the violation is cross-thread. When the C program 
(which existed on a different *stack* than the Ruby interpreter) tried 
to use Ruby's C language API, those API functions would assume that the 
caller existed within the Ruby interpreter's stack.

That's what I remember, anyways. Please correct me if I am wrong. :-)

P.S. The ruby-core developers, such as Nobu Nakada, are much more 
knowledgeable than me; they can tell you more about this.

-- 
Posted via http://www.ruby-forum.com/.