# Repost: Using Ruby fork from C

**URL:** <https://www.ruby-forum.com/t/repost-using-ruby-fork-from-c/174842>\
**Category:** Ruby\
**Created:** [September 2, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/repost-using-ruby-fork-from-c/174842 "2009-09-02T23:44:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [September 2, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/repost-using-ruby-fork-from-c/174842/1 "2009-09-02T23:44:18Z")

</div>

This is a repost of an earlier message posted on ruby-talk-google

As a learning exercise I’m goofing around with ruby’s fork within a C  
program.

I’ve posted my current testing code here: [http://pastie.org/591998](http://pastie.org/591998)

It seems to give me the output I was expecting however, it waits the  
entire 10 seconds before it proceeds to the next fork call.

I thought maybe sleep is somehow blocking or there are likely other  
things I don’t really understand.

Can anyone give me any ideas?

I’m using ruby 1.9.

The goal is to launch ruby processes from this C program. I’m using  
sleep in my tests because I thought it would keep any complication  
down to a minimum.

Thanks for any help you might provide.

Mike B.
