How do I know if a process is being blocked?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How do I know if a process is being blocked?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How do I know if a process is being blocked?  
K-mart Cashier


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-12-07 06:18 AM

This is a cross over from comp.lang.ruby



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
threads.each{|thr| thr.join}

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
threads.each{|thr| thr.join}

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. Is getty blocking
since it's been forked 4 times, but is sleeping?






[ Post a follow-up to this message ]



    Re: How do I know if a process is being blocked?  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-13-07 12:20 AM

On Sep 11, 8:01 pm, K-mart Cashier <cdal...@gmail.com> wrote:

> In this case, the thread isn't creating a process.

How did you establish that? Just because the process isn't running now
doesn't mean it wasn't created.

> Is getty blocking
> since it's been forked 4 times, but is sleeping?

Huh? What do you mean by "blocking"?

DS






[ Post a follow-up to this message ]



    Re: How do I know if a process is being blocked?  
K-mart Cashier


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-13-07 06:19 AM

On Sep 12, 12:44 pm, David Schwartz <dav...@webmaster.com> wrote:
> On Sep 11, 8:01 pm, K-mart Cashier <cdal...@gmail.com> wrote:
> 
>
> How did you establish that? Just because the process isn't running now
> doesn't mean it wasn't created.
> 
>
> Huh? What do you mean by "blocking"?
>
> DS


I ran party and saw the following

-bash-3.2$ ps -j
USER       PID  PPID  PGID     SESS JOBC STAT  TT       TIME COMMAND
cd 28246  5443 28246 e978d8a4    0 Is+   pG    0:00.02 -bash (bash)

It shows the bash prompt, but not party. Now when I grep party, I see
the following

-bash-3.2$ ps waux | grep party
party       55  0.0  0.2   568   996 pG  S+     8:21PM    0:00.10 /usr/
local/bin/party_ (party)


Is this some kind of fork?






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:07 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register