Python Forum
limiting process which stay alive for later
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
limiting process which stay alive for later
#1
there will be N separate processes running this code. these processes listen on a designated port that is different for each process. they listen for a data request. but i want to limit the number of process that will actually send data to only X where X<N. so, i want to discover how many processes are currently sending data. if that number is equal to or greater that X, the process closes the connect without sending data and continues to listen. these processes are not started by a common ancestry, so they cannot inherit any common resources. they all will be running under the same non-root user. the processes that do send data will need to set something when they start and unset it when they end.

the purpose for this is to limit network bandwidth usage. otherwise it could be possible for too many processes to be sending data which can be on the order of many gigabytes each. i would add a random time delay before each process resumes listening to avoid too fast retrying.

although i will be using Linux, a solution that is portable across platforms supporting the current Python version would be helpful for others such as those running Windows.
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
  SNUGBUG © CLI based chatroom app. The CLI IS HERE TO STAY !! itsakshaydilip 1 888 Sep-03-2023, 05:57 PM
Last Post: Skaperen
  limiting number of digits as words in a function Skaperen 0 1,449 Oct-01-2021, 12:08 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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