On Tue, 4 Nov 2008, Dave Wilson wrote:

> Hi all.  And thankyou in advance to anyone who responds.
> 
> I am quite new to Ruby and am working on Windows.
> 
> I need to spawn new threads in ruby on windows which I can do fine, and
> I can see them in the windows process list.  Is there are way of getting
> the process ID back for a thread?

It will be the same as the process id for the whole program. Threads
are done within the process.
> 
> I can not use the Process module as my threads need to run concurrently
> (and everythign I have read says I should be using threads) and every
> time I try the "fork" command I am told its not supported.

It's not on Windows.  What are you trying to do (with the threads)?
You might find that DRb is better and kicking off several ruby programs
that connect to your DRb Server is what you want, if you have enough
processors|cores available.
> 
> I also looked at the windows-pr gem but so far no luck.
> 
> If I can get the ID of the process that the thread is running in I can
> kill it by spawning a kill.exe command, but I have been unable to get
> the process ID.
You will kill the whole program.  Thread#kill already exists.

  x = Thread.new do 
        compute_ultimate_question
      end
  vogon = Thread.new do 
           Thread::kill(x)
          end

> 
> I can not kill the process by name as the name is shared by other
> threads.
> 
> Thanks
> 
> Dave
        Hugh