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 9034819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:35:23+00:00 2026-06-16T08:35:23+00:00

import multiprocessing as mlp class Test(mlp.Process): def run(self): if self.name == Test-2: import time

  • 0
import multiprocessing as mlp

class Test(mlp.Process):
    def run(self):
        if self.name == "Test-2":
            import time
            time.sleep(4)
        print self.name

jobs = []
for i in range(5):
    m = Test()
    jobs.append(m)
    m.run()
for i in jobs:
    i.join()

In the above code, output is always:
Test-1
Test-2
Test-3
Test-4
Test-5

And these processes spawn only one after another. Like Test-3 spans only after Test-2 is completed. Shouldn’t they happen parallely???

And also, i.join() throws error: AssertionError: can only join a started process

What wrong am I doing???

Thanks…

  • 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-16T08:35:24+00:00Added an answer on June 16, 2026 at 8:35 am

    You never started the process. The run method is intended for the subclass to implement, which you correctly did, but the start method is the one you should call to start the process (and automatically execute run() in the other process instance).

    In other words, call m.start() instead of m.run().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code: import multiprocessing class Worker: def run(self, msg): print '%s, it
Basically I have the following code: import multiprocessing import time class MyProcess(multiprocessing.Process): def __init__(self,
When using python-daemon , I'm creating subprocesses likeso: import multiprocessing class Worker(multiprocessing.Process): def __init__(self,
So I have this; from multiprocessing import Process def run(): 4/0 sys.exit() def go(self):
import multiprocessing as mp import time def build(q): print 'I build things' time.sleep(10) #return
In short, say I have the following: import multiprocessing class Worker(multiprocessing.Process): def __init__(self): multiprocessing.Process.__init__(self)
I have following test code executed on Windows: import multiprocessing import time def child()
import org.joda.time.LocalDate; public class Test { public static void main(String[] args) { long time=System.currentTimeMillis();
I had an asynchronous function being called like this: from multiprocessing import Process def
The following program: import multiprocessing,operator f = operator.itemgetter(0) # def f(*a): return operator.itemgetter(0)(*a) if

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.