General information
Category:
Coding, syntax & commands
>Program1 doesn't care about the semaphore, except to create it and delete it when closing.
>
>Program2 cares about the semaphore, but doesn't create it or delete it. And program2 (I assume) can be closed even if there is a semaphore. And the presence of a semaphore doesn't prevent program2 from starting (it expects it to be there).
>
>I'm probably missing a scenario. Why does the semaphore need to be manually deleted?
From original Post;
We want the 2nd EXE to close whenever the primary exe is closed. Does anyone have any code we can reuse to accomplish this?
Assumption:
2nd Exe is running, [you try to close #1 and run into an error / #1 closes because of C0000005]
because of error the code deleting the semaphore file is not run
result process #1 is gone, leaving the semaphore file merrily taking up disk space.
#2 duly checks the semaphore and starts to emulate the VW beetle:
it runs and runs and runs [until you manually close or delete the semaphore]
HTH
thomas
>>
>>Sure that is preferred, but havig a way to clobber a runaway/hanging child process is nicer than to instruct via hotline to delete a semaphore file - which might not even help in a hanging process.
>>
>>regards
>>
>>thomas
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only