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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:21:00+00:00 2026-05-27T11:21:00+00:00

I have a python thread, assigned to a variable name xx, which, when it

  • 0

I have a python thread, assigned to a variable name xx, which, when it completes its’ run function triggers a callback.

The callback eventually tries to create a new instance of that thread with variable name xx, effectively restarting the thread.

Of course, checking xx.isAlive() returns True (since it initiated the callback and has not reached the bottom of its stack). Since xx is still alive, replacing xx seems like a bad idea.

Is one way to deal with this to wait a moment (e.g. gobject.idle_add) before recreating xx so that the run function can complete? Or should I not worry about assigning a new thread instance to xx since the original thread is as good as done anyways by the time it is triggers that callback to recreate itself?

  • 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-27T11:21:01+00:00Added an answer on May 27, 2026 at 11:21 am

    Without understanding the details of your situation, my knee-jerk reaction is to say, Don’t recreate the thread — reuse the established one. It takes less time to reuse the established thread than it would to shut it down and start a new one.

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

Sidebar

Related Questions

I have a multi-threaded application written in Python in which one thread takes care
I have implemented a python webserver. Each http request spawns a new thread. I
I notice this thread: Fastish Python/Jython IPC , and I have a similar problem,
I have simple map-reduce type algorithm, which I want to implement in python and
I have several questions regarding Python threads. Is a Python thread a Python or
I have several python processes which monitor and act upon physical IO. E.g. shut
I have a simple Python web crawler. It uses SQLite to store its output
Given the Python documentation for Thread.run() : You may override this method in a
I have a Python program running a thread that consistently outputs the following: (my_program.py:12313):
I have a python program that calls into a c++ library, which wishes to

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.