Re: My way to check if a progam is already running
- From: Jan Panteltje <pNaonStpealmtje@xxxxxxxxx>
- Date: Sun, 24 Jun 2007 10:00:14 GMT
On a sunny day (Sun, 24 Jun 2007 00:59:43 +0200) it happened Michal Nazarewicz
<mina86@xxxxxxx> wrote in <877ipuqnts.fsf@xxxxxxxxxxxxxxxx>:
I'm not saying that you have to lock one of the data files, however
if it would be possible for two newsreader operate on the same data
files I think that would be the best option.
What I'm proposing is to create a lock file for example in a directory
with all the data files. That is, if you keep all the configuration and
data files in "~/.my-newsreader" you can create a file
"~/.my-newsreader/.lockfile" (using int fd = create(foo, 0600)) and then
lock it (using flock(fd, LOCK_EX)). If locking succeed (providing that
you are not using NFS) you're the only application if it fails there's
some application running already.
Yes, sorry, after posting that last night it hit me that that was what you
were suggesting, I thought you did mean lock every single file.
Yes yours clearly is the best solution, and I will have go at implementing that.
The main advantage I see is not the task switch issue, but now different
users are supported, my solution allowed one and only one instance to run.
I do still maintain that your fear of task switch messing up things were
ungrounded, as for example to start from GUI in my case (fvwm) needs
double click, no way are you doing 2 double clicks within a task switch,
same with key presses.....
Do you want to be mentioned in the code so if it does not work they can come
after you?
.
- Follow-Ups:
- Re: My way to check if a progam is already running
- From: Roger Leigh
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- References:
- My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- My way to check if a progam is already running
- Prev by Date: Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- Next by Date: Re: My way to check if a progam is already running
- Previous by thread: Re: My way to check if a progam is already running
- Next by thread: Re: My way to check if a progam is already running
- Index(es):
Relevant Pages
|