aseker
asked on
Do I Have To Multithread ?
hi everybody
think about that there is one PC and 8 or 9 barcode scanners that are connected to that PC by com ports..i have to do some modifications on a table in my DB by the actions on com ports...
can i handle this by the way below or do i have to multithread ? if yes (multithread) how many threads do i have to design. for each port or a thread ? or for all ports a thread and a thread for other issues
Private Sub port1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialData ReceivedEv entArgs) Handles Port.DataReceived
...
DB modifications
...
End Sub
Private Sub port2_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialData ReceivedEv entArgs) Handles Port2.DataReceived
...
DB modifications
...
End Sub
.......
......
......
Private Sub port9_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialData ReceivedEv entArgs) Handles Port9.DataReceived
...
DB modifications
...
End Sub
think about that there is one PC and 8 or 9 barcode scanners that are connected to that PC by com ports..i have to do some modifications on a table in my DB by the actions on com ports...
can i handle this by the way below or do i have to multithread ? if yes (multithread) how many threads do i have to design. for each port or a thread ? or for all ports a thread and a thread for other issues
Private Sub port1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialData
...
DB modifications
...
End Sub
Private Sub port2_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialData
...
DB modifications
...
End Sub
.......
......
......
Private Sub port9_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialData
...
DB modifications
...
End Sub
ASKER
actually i dont worry about the DB side i worry about the data receive side. i mean if 2 or more com ports receives data at the same time, does this case brake my code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
im not fully satisfied
If i am correct, you connection to database creates something called like a pool.
This will manage your calls to and updates to the database
Greetz!