Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8144531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:24:43+00:00 2026-06-06T13:24:43+00:00

I was trying to work on a component that uses the multiprocessing module in

  • 0

I was trying to work on a component that uses the multiprocessing module in PyDev, but was having problems where running the code was spawning 100s of python processes in the OS and killing my machine. I had my code call run() instead of start(), and it worked fine (except, of course, it was all single threaded since start() is what actually spawns the processes), so that suggests to me that my code was at least not doing anything insane like infinitely generating processes or something. Further, I put together a little test code to see what was up:

from multiprocessing import Process
import time

def create_processes(num_processes, method, *args):

    processes = []
    for i in range(num_processes):
        processes.append(Process(target=method, args=args))
    return processes

def start_all(processes, stagger):

    for process in processes:
        process.start()
        if stagger:
            time.sleep(stagger)

processes = create_processes(2, time.sleep, 4)
start_all(processes, 0)

When I run this in the cli, it works fine; it spawns 2 new processes that end after the timeout. However, when I run it in PyDev, it generates ~600 processes (or at least that’s how many task manager shows before my machine becomes unresponsive). I did a little debugging, and it seems to be blowing up in Process.start() on the line self._popen = Popen(self).

I did a little searching around, but couldn’t really find anything that seemed relevant. Is the CLI automatically join()ing all start()ed processes to some separate manager to keep the reins on? Do I need a thread in my code to join() all my processes to? Is PyDev jacking around with things to try to maintain logging and control? Is something else going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:24:46+00:00Added an answer on June 6, 2026 at 1:24 pm

    If this is the starting point to the code, you should wrap the final two lines with if __name__ == '__main__' in order to prevent the subprocess from starting their own subprocesses:

    if __name__ == '__main__':
        processes = create_processes(2, time.sleep, 4)
        start_all(processes, 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to work with groupby so that I can group together files that were
I´m trying to work with Jzy3D library and paint some charts under openGl. But
I am trying to make Doctrine 2 work. But on the documentation page about
I am trying to extend the flex datagrid component so that I can have
I've spent a long time trying to work this out, but no success thus
I've managed to get my component work with plain Strings and now I'm trying
I am trying work out with MERGE statment to Insert / Update Dimension Table
Trying to work with Eclipse for Android (ADT plugin) development at my iMac (2.4Ghz,
When trying to work with Qt's signal/slot mechanisms over more than one level of
Im trying to work out how to get the value from one setting in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.