in reply to Re: disable possible threads
in thread disable possible threads

hi ,

i'm aware that SQLite can be locked due to that info, but the point is to lock the whole program if there is an attempt to start the program again, and that only holds if another start of the program applies to the program in the same location. If the program is copied to another location then parallelizing it, isn't a problem.

also i know that using a file is not the best way to go, but it is the only way that seems easy and doable :) any other more elegant solution would be a more than welcome.

also since the location is the important factor storing PID wouldn't be of any use , would it ??????

thank you !!

Replies are listed 'Best First'.
Re^3: disable possible threads
by perreal (Monk) on Jun 15, 2009 at 19:41 UTC
    also since the location is the important factor storing PID wouldn't be of any use , would it ??????

    Yes, you can use PID along with the signals to prevent cases when the process is forced to die. As for the location you can use the same file to store location information for running instances as well. But probably you know that already.

    You may also consider listening on a port and use sockets to request permission from the first instance. The fact that you can only listen a port once can be useful. Then you can store all information you need in a file and let the first instance control others.