![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fork() problem | ddx08 | High Level Programming | 3 | 03-01-2007 05:06 AM |
| Error Checking Problem | pokeycam | Shell Programming and Scripting | 4 | 09-13-2006 12:38 AM |
| fork problem | qntmteleporter | High Level Programming | 4 | 01-25-2006 02:56 AM |
| link error problem | niukun | Linux | 4 | 11-18-2004 12:14 AM |
| fork error | santoshsonawane | UNIX for Dummies Questions & Answers | 1 | 08-17-2002 06:59 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Problem due to Fork Error
Hi,
I have developed a datastage job...which has many process running in parallel..but because of Fork Error my job is not working Can any body help me out to solve this Fork error problem. My Os is SUNOS. IS there any setting in Unix through admin where in if i set some paramter my process will get atomatically killed when specific duration has elapsed... Thanks in Advance!! |
| Forum Sponsor | ||
|
|
|
|||
|
there are two approaches to this.
1) set a timer in the child - which generates SIGALRM after specified 'n' units of time, register handler for that signal and in the handler, it should terminate itself 2) have a controller program which takes care of creating new process on need, monitoring them and if it lives more than the threshold trigger it with a signal and accordingly in the child register handler for that signal and it should terminate. Both the methods are doable, and you will have more control with the second approach, as number of child to be spawned, time for which child should live everything can be configured in the invoker process |
|
|||
|
Quote:
Can you please tell me Second Method in detail..means which all commands i have to use(any sample) |
|
|||
|
Hello
While searching in this forum i have found the below link: fork error As per hell666 there is : There's a limit to the number of fork() processes that can exist at any given point in time, and this limit is configurable. This threshold is there somewhere in the control panel (don't remember where), increase this limit. So can anybody tell me what exactly i have to set?? Thanks in Advance! |
|
|||
|
Please do read the rules of the forum and donot bump up with questions if they are not promptly answered.
Coming to the point, monitor program would be a parent process which would fork() to create new child process, better to have some kind of count to control the child process creation ( MAX_CHILD_PROCESS_ALLOWED ), once fork is successful parent gets the child pid, store them in an array or any other data structure, check for the existence of the child by sending kill -0 ( to see if they exist ), or register any signal handlers in the child if any communication needs to be carried over between parent and child. This is just a pointer and you will have many interesting challenges like daemon -izing, defunct process creation etc. Give it a shot, post us if you are stuck up somewhere. |
|
|||
|
fork() error
As mentioned, this is sometimes due to a resource limitation, but you would be seeing a long list of "child" processes in your "ps" command if that were the case. Memory leaks can exhaust available RAM, which can also result in fork failures. The "second option" mentioned here is often done through use of IPC's such as semaphore's. We also use these for management of threads. Threads are more efficient because it does not cause a full process duplication. There are pthread.h management facilities available also, very cool to use and to have in your code.
The question gets down to whether one is multi-processing with the same code, or doing a fork/exec in order to spawn a completely separate process. Does this help? |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|