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

  • Home
  • SEARCH
  • 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 6853563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:31:38+00:00 2026-05-27T01:31:38+00:00

thread.start_new_thread(target=self.socketFunctionRead1()) print Thread 1 thread.start_new_thread(target=self.socketFunctionWrite1()) print Thread 2 thread.start_new_thread(target=self.socketFunctionRead2()) print Thread 3 thread.start_new_thread(target=self.socketFunctionWrite2()) print

  • 0
thread.start_new_thread(target=self.socketFunctionRead1())
print "Thread 1"
thread.start_new_thread(target=self.socketFunctionWrite1())
print "Thread 2"
thread.start_new_thread(target=self.socketFunctionRead2())
print "Thread 3"
thread.start_new_thread(target=self.socketFunctionWrite2())
print "Thread 4"

I am trying to start multiple threads, but only one thread is started, how can I make the program go further by starting the other threads?

  • 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-05-27T01:31:38+00:00Added an answer on May 27, 2026 at 1:31 am

    Instead of thread.start_new_thread(target=self.socketFunctionRead1()),

    try thread.start_new_thread(target=self.socketFunctionRead1)

    Because of the parenthese, the function is called and the return value of the function is assigned to target. Since thread.start_new_thread(target=self.socketFunctionRead1()) is probably a blocking call, only this function gets called.

    In thread.start_new_thread, target should be a callable (An object that behaves like a function).

    Edit:

    From the Python documentation:

    thread.start_new_thread(function, args[, kwargs])

    Start a new thread
    and return its identifier. The thread executes the function function
    with the argument list args (which must be a tuple). The optional
    kwargs argument specifies a dictionary of keyword arguments. When the
    function returns, the thread silently exits. When the function
    terminates with an unhandled exception, a stack trace is printed and
    then the thread exits (but other threads continue to run).

    This means that you should call thread.start_new_thread(self.socketFunctionRead1).

    If you pass keyword arguments to start_new_thread, they will get passed to self.socketFunctionRead1.

    The target for your thread is required and not a keyword argument.

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

Sidebar

Related Questions

I am trying to start a new thread in VB.NET and I'm having syntax
I'm trying to run NSURLConnection async in a secondary thread (target is iOS4), for
If i use thread like this: void foo() { new Thread().Start(); } since the
Here is my code: ThreadStart threadStart = controller.OpenFile; Thread thread = new Thread(threadStart); thread.Start();
Given the code: new Thread(new BackgroundWorker()).start(); Intuitively it feels like the BackgroundWorker instance should
I want to start a new thread using a C function, not an objective-C
I have a PyQt program, in this program I start a new thread for
When would you call Java's thread.run() instead of thread.start() ?
I'm simulating some threading in a Windows Service, and the Thread.Start routine for each
Why do we need to run the thread through start method and not directly

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.