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
  Shared reference of variables... Denial 1 1,373 Aug-29-2020, 01:52 PM
Last Post: snippsat
  Get stdout of a running process yok0 0 2,975 Aug-20-2020, 10:12 AM
Last Post: yok0
  How to install and use a shared libary, via a .dll? ninjaisfast 0 1,271 Jul-09-2020, 03:23 PM
Last Post: ninjaisfast
  How to sharing object between multiple process from main process using Pipe Subrata 1 3,617 Sep-03-2019, 09:49 PM
Last Post: woooee
  Divisors shared the second numbers mircea_dragu 1 2,015 Feb-07-2019, 10:09 PM
Last Post: ichabod801
  Multiprocessing Module Running An Infinite Child Process Even After Completion hsikora 0 3,835 Dec-19-2018, 08:01 AM
Last Post: hsikora
  Pausing a running process? MuntyScruntfundle 2 7,137 Nov-14-2018, 05:14 PM
Last Post: woooee
  Shared reference and equality zyo 3 3,096 Jun-30-2018, 07:10 PM
Last Post: ljmetzger
  Shared queues l00p1n6 3 2,947 May-15-2018, 01:38 PM
Last Post: DeaD_EyE
  two different objects, but somehow the values are shared between them RaphaelMG 6 4,046 Apr-20-2018, 05:53 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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