nisa
asked on
How do I prevent multiple instances of same process to run at the same time?
Hello,
I would like to know the proper way to prevent the same instance of processes from running at the same time on UNIX. I would like to allow only one instance of process to run. If the same program were to execute again, it will check if there is same instance already running. If yes, then it will immediately terminate itself.
Best regards,
Nisa.
I would like to know the proper way to prevent the same instance of processes from running at the same time on UNIX. I would like to allow only one instance of process to run. If the same program were to execute again, it will check if there is same instance already running. If yes, then it will immediately terminate itself.
Best regards,
Nisa.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your additional question depends entirely on what the script is doing.
There are a lot of commands that have C library equivalents, it all depends on what functions you are trying to do.
There are a lot of commands that have C library equivalents, it all depends on what functions you are trying to do.
ASKER
I accept the answer, thanks!. I have another question, I will give u extra 50 pts for that (if u have the info):
I know that we can use unix "system()" call ie system(<the script command here>) so that my C program can call it internally. Is there any alternative I can use ie by using unix call directly (without using the script) from the C program?
Best regards,
Azmi.