From: Shane Emmons Date: 2006-12-02T03:22:49+09:00 Subject: Re: pthreads ------=_Part_3117_25828076.1164997366861 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks for the information, hopefully Ruby threads will be good enough. On 12/1/06, Tim Pease wrote: > > On 12/1/06, Shane Emmons wrote: > > I need to write a quicksort using pthreads, and was hoping to use Ruby > to do > > so (the Prof. just loves C/C++). Can anyone shed some light on what > > compiling ruby with pthreads actually does, and what I need to do to > write > > pthreads in Ruby? Thanks for any help. > > > > The pthreads option when compiling Ruby is there to make it play nice > with the Tcl/Tk widget set. If your Tcl/Tk is compiled with the > pthreads option, then Ruby needs to be compiled with the pthreads > option. If this is not the case then you could get segmentation faults > when you try to use the Tcll/Tk widgets. > > Ruby does not use pthreads internally. All threads are implemented as > green threads -- i.e. there is only one Ruby process and all threads > are scheduled internal to that process. > > If your professor truly wants pthreads for your quicksort assignment, > then Ruby is not going to make him happy. However, if you can convince > him that the Ruby Thread object is good enough (close enough) to a > pthread, then more power to ya! > > Blessings, > TwP > > -- --- Shane Emmons ------=_Part_3117_25828076.1164997366861--