Thread Safety in pySerial
<p>I'm programming with Python 3.</p>

<p>I have two serial ports (pySerial). I have written a dispatcher class for dispatching control signal transitions and data for such a port. This dispatcher runs in its own thread.</p>

<p>Each dispatcher is given two listeners each. One listener logs to a file, the second routes to the other serial port. This allows me to log traffic between two ports while the data and signals can still flow between the two. At a later stage I might wish to manipulate the traffic also for certain test cases and this interface should allow me to do this rather easily. </p>

<p>So for serial1, I am calling serial1.readlines, serial1.GetCTS etc in Thread1 and serial1.writelines, serial1.SetRTS etc from Thread2.</p>

<p>And for serial2, I am calling serial2.readlines, serial2.GetCTS etc in Thread2 and serial2.writelines, serial2.SetRTS etc from Thread1.</p>

<p>Is this thread safe and if not, what are the issues and how might I remedy them.</p>

<p>Thanks,</p>

<p>Barry</p>
