HOW DO I FIGURE OUT HOW MANY PROCESSES ARE RUNNING?

HOW DO I FIGURE OUT HOW MANY PROCESSES ARE RUNNING?

Post by Loren Ko » Tue, 28 May 1996 04:00:00



I am trying to write a program that forks a bunch of times, but it needs
to know how many processes are already running so it doesn't use em all
up.  Any suggestions?

Loren

 
 
 

HOW DO I FIGURE OUT HOW MANY PROCESSES ARE RUNNING?

Post by kient.. » Thu, 30 May 1996 04:00:00


Try:

man 2 getrlimit   -- to find out how many processes your User ID is permitted

If you know how to read a directory, you can skim through /proc
to count how many processes are owned by this UID already.
(do `ls -l /proc' to  see the info it gives, `man procfs' for
details on /proc).

Also look at `man csh' for info on the `limit' built-in command.

                                - Tim Kientzle



>I am trying to write a program that forks a bunch of times, but it needs
>to know how many processes are already running so it doesn't use em all
>up.  Any suggestions?

>Loren


 
 
 

1. Am running a process in bg without an & ????

Hi all,

Something very interesting here!

#
# File back.ksh has the following contents
sleep 10 | >> outfile | /bin/ksh

Now, I invoked the following.

$ /bin/ksh back.ksh

The "sleep 10" process is fired in the background o:)
And i got my shell prompt immediately.

However, when i run just that line from command line, it's fired in the
foreground.

I found this problem when i was looking at some bug (in fact this one),
which was using something like (something like in the sense, it was not
sleep 10 there, but some process taking some time and generating some o/p).

sleep 10 | tee >> outfile | /bin/ksh

to append the contents to outfile.  The contents are appended right, but
the stuff is run in background (even tee) and causing lot of problems.
If i used the correct usage there, i.e. "tee -a outfile", everything went
fine.  

And if I execute back.ksh file with the contents

sleep 10 | >> outfile

it's in the foreground.

I'm using Dynix/ptx 4.0 on sequent's symmetry machines.

Thanks in advance for all u'r time.
regards,
shailesh

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ph #s: (O) 503 - 578 - 5706
       (R) 503 - 629 - 9643
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

2. sed relative line addressing

3. I am with the following error, when i am running lilo...

4. What is a Winmodem!?!?!?!?

5. I am in text mode, what browser am I running....

6. Extract string from this text (sed)

7. Am I figuring out this disk path correctly?

8. Problem with DNS through a gateway

9. Error when compiling - trying to figure what I am missing

10. Error when compiling - Trying to figure out what i am missing.

11. How do I figure out which version of KDE I am using?

12. Error when compliling - trying to figure out what i am missing.

13. Error while compiling - Trying to figure out what I am missing