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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:38:22+00:00 2026-05-23T21:38:22+00:00

Question: why is my DAL not running off on its own thread? I’ve got

  • 0

Question: why is my DAL not running off on its own thread?


I’ve got this program I’ve been working on that I implemented a simple file manager back end on. This is far from my first experience working with threads, but for some reason I just can’t get this one working. I instantiate my DAL here:

    self.DAL = DAL(path)
    ##prepare the reactor
    self.DALrec = threading.Thread(target=self.DAL.reactor,name='DALReactor')
    self.DALrec.run()

The reactor has this in it:

    def reactor(self):
        while not self.kill:
            ##check for new entries:
            for i in self.ins:
                self.save(i)

            ##wait a minute before checking again.
            time.sleep(60)

Not complicated. I instantiate the DAL which goes down with out a hitch and then instantiate a thread, just like I’ve always done. But for some reason I’m getting a really bazaar behavior out of this. Instead of calling ‘run’ and the main thread continuing on leaving the thread to its own business, it is treating ‘run’ as if I was calling self.DAL.reactor() from the main thread. In my debugger (winpdb, which worked on my previous version of this program) I should be seeing a new thread being created, but there remains only one thread.

Anyone have any idea why I only have one thread here instead of two? 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-05-23T21:38:23+00:00Added an answer on May 23, 2026 at 9:38 pm

    You should call start, to run the run method in a separate thread. Otherwise run is called as any other method.

    From docs:
    Once a thread object is created, its activity must be started by calling the thread’s start() method. This invokes the run() method in a separate thread of control.

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

Sidebar

Related Questions

Earlier I asked this question How to correctly unit test my DAL? , one
This is just another working in dev server, why not working in IIS type
I previously asked a similar question on this topic a while back and got
NOTE: I am not an expert, so if you feel this question stupid/lame please
Let me qualify this question. I'm working on a classic ASP.NET application (Web Forms)
I have a (DAL) Data Access Layer (but this question is relevant for DAOs
Question Can I build a image database/library that has an e-commerce style checkout system
Question Is there a way to have a method that will always run anytime
I am currently working on server application that has to deal with reasonable amount
Hi this is a question to all experienced developers who create their web applications

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.