a question: handling tasks
Hi,
I'm trying to develop an application through traditional c language, which is gonna run as a single instance within the system. Been looking on the internet for singleton (which seems to stand for OO programming languages, single instance appl, etc.), and also seen howtos and papers talking about user and kernel modes.
Maybe the right
solution would be to use sempahores and threads, but I get confused because almost all the doc on this is written for solaris which hasn't got the same API as pthreads.
The thing is that, in case of the user
trying to execute another instance of the appl. the already running one could catch the first argument used to call the second instance and pass it through a function.
I know this is not the right place for
asking this, been looking for weeks, and I haven't found any document on the internet on how to do somehting like this with linux, and for sure any of you could bring some light into this.
Kind Regards,
Quoted 4 lines · On Maw, 2005-12-13 at 16:29 +0100, [email protected] wrote:
The thing is that, in case of the user
trying to execute another instance of the appl. the already running one could catch the first argument used to call the second instance and pass it through a function.
Not really a kernel question. Various daemons implement something similar using simple file locks and then sockets to pass messages between instances of a program.
It's not the usual mentality of Linux/Unix programs but you'll find examples that do it to look at - one is evolution, another is mozilla/firefox as shipped by at least Fedora (not all vendors use the single instance/multiple windows code). Various other gnome apps such as gnome terminal support this way of working too and Gnome implements a set of factory objects and activation system for this purpose