[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] Xforms & threads-functions & others

From: alessandro basili
Subject: Re: [XForms] Xforms & threads-functions & others
Date: Mon, 10 Oct 2011 09:48:52 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

On 10/7/2011 9:00 PM, Sergey Klimkin wrote:
> Hi Jens,
>>> 1
> Everything is very clear, I'll fix, thanks.
> Multithreading is required for work with serial port, I see no other
> solution.
> After switching the data flow from the serial port can not access other
> windows until it stopped the flow.
> Functions to work with serial port in a separate file and do not cause
> functions xforms.

Probably I don't see the full picture but I don't understand why you
need multithreading.
We have developed serial and parallel port communication with different
types of devices simply with state machines. You can use
fl_add_timeout() or fl_add_timer() to invoke the state machine if the
comm. is very lengthy, but it is essential that in the state machine you
don't wait forever (i.e. return when timeout expires).

IMHO threads are needed only when you really need two process going on
at the same time, otherwise your program will be unnecessarily complex
and very difficult to test (be aware that multithreading is non
deterministic by definition, since there's no way to control at what
time which thread is doing what).

I found this document for Serial Comm. Programming very useful:


By the way, setting up a server-client communication over the TCP stack
is rather simple and you may have the server communicating with the
hardware (serial port) and the client being the interface. All our tools
work both ways (on client-server mode or direct mode).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]