4 ms·
Could you elaborate on what makes that a great way to check and what advantage that has over other methods?
by memco 4y ago
Could you elaborate on what makes that a great way to check and what advantage that has over other methods?
- saagarjha 4y agoIt doesn’t do anything but returns a result based on the existence of the process and your ability to signal it, which makes it a sort of “dry run” of sorts. Note that such a check is inherently racy, though.
- LunaSea 4y ago> Note that such a check is inherently racy, though. Do you mean in a kind of "time of check vs. time of use" kind of way? I would suppose that if the answer is negative that would at least stay true no?
- saagarjha 4y agoYes. If the process exits (and is perhaps replaced by something else!) in between the two checks you will take actions based on stale information.