F
FP
Hi,
i'm currently developing a class to communicate with a serial device,using
the SerialPort component.
Basically,the main application will interact with this class through its
method "Call",the class itself will handle all the details of a call (AT
commands included).
My problem is that i dont want the application to hang while i'm
interacting with the modem,so i have started to learn about threading.
Many people have suggested me to use BeginInvoke/EndInvoke,which relies on
pooled threads,but i just found out in some articles that author suggests
not to use pooled threads for tasks that lasts more than few seconds,which
is not my case (it might last some minutes).
Now i wonder: does this advice apply only when my application spawns many
threads? I.e. is the thread pool shared with other processes,so i have to
worry about not blocking other processes' thread pools?
So far i'm not yet sure whether to use the BeginInvoke/EndInvoke or create
a new thread,since after all my modem is a finite state machine,and i was
thinking to events as the way to signal state transitions to the main
application.Which approach would you suggest?
Thanks in advance
i'm currently developing a class to communicate with a serial device,using
the SerialPort component.
Basically,the main application will interact with this class through its
method "Call",the class itself will handle all the details of a call (AT
commands included).
My problem is that i dont want the application to hang while i'm
interacting with the modem,so i have started to learn about threading.
Many people have suggested me to use BeginInvoke/EndInvoke,which relies on
pooled threads,but i just found out in some articles that author suggests
not to use pooled threads for tasks that lasts more than few seconds,which
is not my case (it might last some minutes).
Now i wonder: does this advice apply only when my application spawns many
threads? I.e. is the thread pool shared with other processes,so i have to
worry about not blocking other processes' thread pools?
So far i'm not yet sure whether to use the BeginInvoke/EndInvoke or create
a new thread,since after all my modem is a finite state machine,and i was
thinking to events as the way to signal state transitions to the main
application.Which approach would you suggest?
Thanks in advance