From: Donald Sharp Date: 2001-03-21T04:46:56+09:00 Subject: [ruby-talk:12977] Re: Native/pthreads in Ruby On Tue, Mar 20, 2001 at 05:34:27PM +0900, Yukihiro Matsumoto wrote: > Hi, > > In message " Native/pthreads in Ruby" > on 01/03/20, Christopher Petrilli writes: > > |I read everything I could find in the archives talking about > |implementing pthreads in Ruby, and I'm wondering if anyone has started > |on this. I'm working on a project which is pretty I/O intensive and > |this would help enormously in writing a fast version. I'm currently > |working to convert the code from Python (which uses pthreads), and I'm > |running into that wall. > | > |Ideas? > > The conservative GC which Ruby is using does not work well with > pthreads. Unfortunately pthread does not provide the way to get stack > boundary of each thread. You have to restrict Ruby interpreter to be > run on only one thread to get along with native threads. Sure it does through these calls: pthread_attr_setstackaddr(); pthread_attr_getstackaddr(); pthread_attr_setstacksize(); pthread_attr_getstacksize(); You should set the stack and then do a pthread_create()... donald > > matz. >