The getty is a daeamon
When I do soemthing like
#!/usr/local/bin/ruby
threads=[]
4.times do |i|
threads[i]=Thread.new do
%x{/usr/libexec/getty std.19200 tty00}
end
end
I see the following
-bash-3.2$ ps -j
cd 1877 10367 1877 d6bd16c0 1 I ph 0:00.01
/usr/local/bin/rub
cd 29342 1877 1877 d6bd16c0 1 I ph 0:00.00
/usr/libexec/getty
cd 2773 1877 1877 d6bd16c0 1 I ph 0:00.00 /usr/libexec/getty
cd 30538 1877 1877 d6bd16c0 1 I ph 0:00.01
/usr/libexec/getty
cd 6442 1877 1877 d6bd16c0 1 I ph 0:00.01
/usr/libexec/getty
Each thread is creating a new process.
However, when I change to the same code to a program that isnt a unix
daemon
like
#!/usr/local/bin/ruby
threads=[]
4.times do |i|
threads[i]=Thread.new do
%x{/usr/local/bin/party
}
end
end
I see the following
-bash-3.2$ ps -j
cd 29735 15232 29735 d6bd1d80 0 Is+ ph 0:00.06 -bash (bash)
cd 12524 29735 12524 d6bd1d80 1 T ph 0:00.02
/usr/local/bin/rub
In this case, the thread isn't creating a process. Can someone shed some
light on this behavior or discrepancy.
···
--
Posted via http://www.ruby-forum.com/.