Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is thread running?
#1
I have an app that fires off a bunch of threads, each starting client code to collect data from a socket server on an ip address.

The app starts the threads.
The threads get answered.
The threads process data.
The threads close.
Start again.

Which is all fine until...

The app starts the threads.
Some threads don't get answered.
Some threads don't process data.
Some threads don't close.
Start again. >> Now I have 2 threads open trying to connect to a bunch of ip address' that aren't going to answer.

At the moment this is pretty much code all on the first indent. I assume the best thing to do is write a class with all the handling code inside, then we set off instances of the class checking against an arbitrary field.

Is this the way to go, or is there a better idea?

Many thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a way to not terminate a running thread in python Contra_Boy 3 2,000 May-05-2020, 09:38 PM
Last Post: SheeppOSU
  Pyinstaller keeps thread running pythonuser_0101 2 3,157 Mar-06-2020, 02:09 PM
Last Post: pythonuser_0101
  Error SQLite objects created in a thread can only be used in that same thread. binhduonggttn 3 15,603 Jan-31-2020, 11:08 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020