Thread is somehow interfering with a while loop called after thethread is started

D

dan.h.mcinerney

I have a simple scapy + nfqueue dns spoofing script that I want to turn into a thread within a larger program:

http://www.bpaste.net/show/HrlfvmUBDA3rjPQdLmdp/

Below is my attempt to thread the program above. Somehow, the only way the while loop actually prints "running" is if the callback function is called consistently. If the callback function isn't started, the script will neverprint "running". How can that be if the while loop is AFTER the thread wasstarted? Shouldn't the while loop and the thread operate independantly?

http://bpaste.net/show/0aCxSsSW7yHcQ7EBLctI/
 
I

Irmen de Jong

I have a simple scapy + nfqueue dns spoofing script that I want to turn into a thread within a larger program:

http://www.bpaste.net/show/HrlfvmUBDA3rjPQdLmdp/

Below is my attempt to thread the program above. Somehow, the only way the while loop actually prints "running" is if the callback function is called consistently. If the callback function isn't started, the script will never print "running". How can that be if the while loop is AFTER the thread was started? Shouldn't the while loop and the thread operate independantly?

http://bpaste.net/show/0aCxSsSW7yHcQ7EBLctI/

Try adding sys.stdout.flush() after your print statements, I think you're seeing a
stdout buffering issue.


Irmen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,237
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top