![]() |
| | #1 |
| Registered User Join Date: Sep 2003
Posts: 30
| Stopping Processes Question I would firstly like to say a huge thank you to all of you in these forums. You have been so very helpful in the past and its just really great to have this kind of community online. Ok now to the question: I'm using the kill(int pid, SIGSTOP); function to stop a process group (job) when server load gets too high and then restart it again when the servers load goes down again. I just ran my program then and it ran perfectly, however its performance is not reliable. Sometimes the stopping and starting of the process group seems to cause a failure - one of the child processes doesn't stop properly and half of the processes stop and the other half don't. This leads to the process group being broken and obviously a failure. I've tried running my program and watching closely what happens, but like I said before - this time it all worked perfectly. So my question is can anyone tell me is there a time limit on how long a process group can be in the "STOPPED" (or susended) state? I was thinking that perhaps on previous runs the load may have stayed higher for longer and caused the process group to be "STOPPED" for many minutes at a time. I was thinking maybe there was a time limit for how long a process can be stopped? Or can anyone else think of a reason why the process group (job) would break down and you end up with 2 groups of processes and a failure? Can anyone think of how I could test for this and avoid such a problem? I did notice that when it failed previoulsy the parent process zombied and the child processes kept running and I could not even stop them myself manually from the command line. Is there anyway you could test a process if its stoppable, prior to actually stopping it? What reasons would a process not be stoppable? Thanks you very much to anyone who adds any insight. |
| brett is offline | |
| | #2 |
| Registered User Join Date: Sep 2003
Posts: 30
| Any kind of input is welcomed |
| brett is offline | |
| | #3 |
| Deathray Engineer Join Date: Mar 2007
Posts: 3,211
| You don't have the patience to wait half an hour before posting again? ![]() This type of question is better suited in the Linux section since it's a Unix/Linux question, not firmly related to C.
__________________ |
| MacGyver is offline | |
| | #4 |
| Registered User Join Date: Sep 2003
Posts: 30
| Yes I can wait ![]() Just letting people know I'm interested in all ideas and input from other. I've just changed the usage of the kill function, before I was using kill(-pgid, SIGSTOP) to stop the process group, however I just discovered there's a specific kill function for sending signals to process groups - killpg(int pgid, SIGNAL). I don't think this will make any difference but doesn't hurt to add. Also I was wondering if there's a limit to the number of times a process group can be stopped and started? |
| brett is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| another do while question | kbpsu | C++ Programming | 3 | 03-23-2009 12:14 PM |
| beginner question about stopping a for-loop. | Techboy10 | C Programming | 3 | 12-11-2008 05:15 PM |
| Question... | TechWins | A Brief History of Cprogramming.com | 16 | 07-28-2003 09:47 PM |
| Computer Processes.... Which can be stopped? | Sevrin | Tech Board | 3 | 06-08-2003 08:13 PM |
| opengl DC question | SAMSAM | Game Programming | 6 | 02-26-2003 09:22 PM |