Python Forum
running just one process shared among uses
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
running just one process shared among uses
#1
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.
Reply
#2
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?
Reply
#3
You can definitely model a buss in Python. Just implement the logic: https://en.wikipedia.org/wiki/Bus_(computing)
Reply
#4
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem running external process rjdegraff42 0 290 Mar-19-2025, 07:50 PM
Last Post: rjdegraff42
  Get stdout of a running process yok0 0 4,369 Aug-20-2020, 10:12 AM
Last Post: yok0
  How to sharing object between multiple process from main process using Pipe Subrata 1 4,440 Sep-03-2019, 09:49 PM
Last Post: woooee
  Multiprocessing Module Running An Infinite Child Process Even After Completion hsikora 0 4,907 Dec-19-2018, 08:01 AM
Last Post: hsikora
  Pausing a running process? MuntyScruntfundle 2 9,349 Nov-14-2018, 05:14 PM
Last Post: woooee
  Shared queues l00p1n6 3 3,620 May-15-2018, 01:38 PM
Last Post: DeaD_EyE
  Stopped process is still running pawlaczkaj 9 6,222 Apr-08-2018, 10:22 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020