how retard controlling twin instances same program?
i need certain user run wholly instance way during time.
which means, i have check programatically, presumably same way already running, quit such case.
the initial thing came mind emanate record somewhere, way starts. then, any instance way check record exit found it.
the problem is, way contingency always exit gracefully means mislay record created, work.
in box of, say, appetite outage, close record stays place way can't started again.
to solve this, i solid store initial program's slight id close record another instance starts, checks pid record trustworthy controlling process.
if record doesn't exist, empty, pid doesn't conform any existent process, way continues run writes the possess pid file.
this seems work definitely glorious - even after an astonishing shutdown, luck (now obsolete) slight id compared program, seems definitely low.
but still doesn't feel right (there is luck removing sealed separate process) operative slight ids seems over customary c++ substantially isn't unequivocally unstable either.
so, there another (more purify secure) proceed doing this? ideally work iso 98 c++ customary windows *nix alike.
if can't finished platform-independently, linux/unix priority me.
Comments
Post a Comment