Which operating system do you use?
What do you know about the process you search for? If it's not its PID then there is no way to do it in an atomic operation. Tools like pgrep, pkill and killall search within the proc filesystem and can't be atomic.
Don't worry about your same PID problem. Linux for example uses 32768 different PID values. See and change PID_MAX_DEFAULT in include/linux/threads.h if that's not enough for you.
-- Frank
In reply to Re: atomic operations
by haoess
in thread atomic operations
by kcella
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |