Skip to content

Instantly share code, notes, and snippets.

@emboss
Created January 29, 2015 09:56
Show Gist options
  • Save emboss/506f0976c7a46068b35a to your computer and use it in GitHub Desktop.
Save emboss/506f0976c7a46068b35a to your computer and use it in GitHub Desktop.

Revisions

  1. emboss created this gist Jan 29, 2015.
    16 changes: 16 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    t = Thread.new do
    pid = Process.fork do
    loop do
    puts "Hi"
    sleep 0.5
    end
    end
    puts "Use 'kill -9 #{pid}' to kill me!"
    Process.wait pid
    end

    sleep 2
    t.kill


    # And it keeps running...