Posts: 4,646
Threads: 1,493
Joined: Sep 2016
a lot of programs, particularly big GUI programs like web browsers, will use the previously started process when an attempt is made to start a 2nd concurrently running process of the same program. can this be done in Python for an application to be written in Python? what would be the best way to do it?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,646
Threads: 1,493
Joined: Sep 2016
(Aug-06-2018, 09:33 PM)nilamo Wrote: The way I think this is normally done, is the program is split into two parts, a "manager", and the actual program. Then the manager opens a named pipe or port, and starts listening for events. If that resource already exists, then it assumes that the program is already running, and sends a message to the already running manager, something like "open http://www.google.com", and then it immediately quits after sending the message. The manager that was already running, will then see the message, and pass it to the underlying program.
Does that make sense?
yeah. once the window is open, the new process can transfer the file descriptor for the window over that named pipe connection.
but ... i have looked for such named pipes and did not find any, for many programs. they must have some other means.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.