search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

0 answers
Q&A thread starts running before calling Thread.start
thread starts running before calling Thread.start
P粉718730956 2025-12-31 09:43:21 Views 144

0
t1=threading.Thread(target=self.read())
print("something")
t2=threading.Thread(target=self.runChecks(), args=(self,))

self.read runs indefinitely, so the program won't ever reach the print line. How is this possible without calling t1.start()? (Even if I call that, it should start running and go on to the next line, shouldn't it?)


See also: What does it mean when the parentheses are omitted from a function call (supposing no arguments are necessary)? for a deeper understanding of the bug, and Python Argument Binders for a more general solution.

Your Answer
submit

0 answers

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use