Hi everyone,<br><br>I hope that someone can help me understand a little bit better on how to work with threads in Lazarus. I am still learning so please forgive my ignorance in any matter here. I am using the multithreading.lpi example supplied with lazarus and I create a type TMyThread of class TThread and I have the Execute and other procedures made for the TMyThread thread. I have got the thread running well, but now I dont understand how to make another instance of the same thread and how write my code to identify which instance is running so that I can assign different tasks to each thread individually.<br>
<br>On Form Create Procedure I have (as in the mulithreading example), MyThread := TMyThread.Create(False); This creates and instance of the type TMyThread. I got that. I got that working. Now with the same procedures if I go ahead and create another instance in the On Form Create Procedure, MyThread2 := TMyThread.Create(False); How do I use this second instance to do different work in the same procedures. I hope that whoever reads this can get what I am saying. I will post a link to the code below and I hope that someone can advise me. Any help is much appreciated.<br>
<br>If I may add, I am using the thread to read data from a modem from the RS232, but now I have more than one modem connected to the system that I need to read from at once and having it run in one thread gets slower as I add one modem extra to the thread, I want to use the second instance, TMyThread2 to control the modem 2.<br>
<br><a href="http://www.heypasteit.com/clip/0FVU">http://www.heypasteit.com/clip/0FVU</a><br><br>Please I am desperate to know how to use this correctly.<br><br>Thank you kindly.<br><br>Clinton Wright<br>