B4J Question Classes in threads?

techknight

Well-Known Member
Licensed User
Longtime User
Is there a threading library for B4J that could launch a thread for each class instance?

I am trying to write a program that initializes a class array, but it would be ideal if i could initialize each Class as its own thread that way connections/etc can happen in parallel without one class having an issue or slowdown hanging up all the other classes on the main thread. Each class is a connection out to an MQTT server as well as handling data to/fro that server on a specific subtopic set during the initialization of that class. There could be 10 instances of that class or more running listening/performing operations on specific subtopics/topics in parallel.

Only other way i can think of is launch multiple instances of the jar versus one jar with multiple threads.

Any ideas? thanks.
 

agraham

Expert
Licensed User
Longtime User
This should work
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Is there a threading library for B4J that could launch a thread for each class instance?

I am trying to write a program that initializes a class array, but it would be ideal if i could initialize each Class as its own thread that way connections/etc can happen in parallel without one class having an issue or slowdown hanging up all the other classes on the main thread. Each class is a connection out to an MQTT server as well as handling data to/fro that server on a specific subtopic set during the initialization of that class. There could be 10 instances of that class or more running listening/performing operations on specific subtopics/topics in parallel.

Only other way i can think of is launch multiple instances of the jar versus one jar with multiple threads.

Any ideas? thanks.
Consider using abbackground worker lib
 
Upvote 0
Top