Re: Async serial communication/threads sharing data

2009-04-11 Thread Jean-Paul Calderone
On Wed, 25 Mar 2009 22:23:25 -0700, John Nagle na...@animats.com wrote: Jean-Paul Calderone wrote: On Tue, 24 Mar 2009 22:20:49 -0700, John Nagle na...@animats.com wrote: Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul

Re: Async serial communication/threads sharing data

2009-03-27 Thread JanC
Jean-Paul Calderone wrote: These days, serial ports are on the way out, I think. I don't see generic USB and bluetooth serial devices disappear that fast... E.g. AFAIK (almost?) all GPS receivers have to be accessed as serial devices (mine even looks like a generic USB-to-serial device to the

Re: Async serial communication/threads sharing data

2009-03-25 Thread Jean-Paul Calderone
On Tue, 24 Mar 2009 22:20:49 -0700, John Nagle na...@animats.com wrote: Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] After bringing in all the heavy machinery of Twisted,

Re: Async serial communication/threads sharing data

2009-03-25 Thread John Nagle
Jean-Paul Calderone wrote: On Tue, 24 Mar 2009 22:20:49 -0700, John Nagle na...@animats.com wrote: Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] After bringing in all the heavy

Re: Async serial communication/threads sharing data

2009-03-24 Thread John Nagle
Hendrik van Rooyen wrote: Nick Craig-Wood ni...g-wood.com wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. Not sure if this is Twisted's fault - do python sockets have automatic

Re: Async serial communication/threads sharing data

2009-03-24 Thread John Nagle
Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] After bringing in all the heavy machinery of Twisted, you're still polling at 10Hz. That's disappointing.

Re: Async serial communication/threads sharing data

2009-03-23 Thread Hendrik van Rooyen
Nick Craig-Wood ni...g-wood.com wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. By that I mean I could pump data into a 9600 baud serial port at 10 Mbit/s. Twisted would then

Re: Async serial communication/threads sharing data

2009-03-23 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Sun, 22 Mar 2009 12:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. By that I

Re: Async serial communication/threads sharing data

2009-03-23 Thread Jean-Paul Calderone
On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] In the case of a TCP to serial forwarder, you don't actually have to implement either a producer or a consumer, since both the TCP connection and the serial

Re: Async serial communication/threads sharing data

2009-03-23 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] In the case of a TCP to serial forwarder, you don't actually have to implement either a producer or a

Re: Async serial communication/threads sharing data

2009-03-22 Thread Hendrik van Rooyen
Nick Timkovich prom@gmail.com wrote: I've been working on a program that will talk to an embedded device over the serial port, using some basic binary communications with messages 4-10 bytes long or so. Most of the nuts and bolts problems I've been able to solve, and have learned a

Re: Async serial communication/threads sharing data

2009-03-22 Thread Nick Timkovich
On Mar 21, 9:19 pm, Jean-Paul Calderone exar...@divmod.com wrote: On Sat, 21 Mar 2009 13:52:21 -0700 (PDT), Nick Timkovich prometheus...@gmail.com wrote: I've been working on a program that will talk to an embedded device over the serial port, using some basic binary communications with

Re: Async serial communication/threads sharing data

2009-03-22 Thread Jean-Paul Calderone
On Sun, 22 Mar 2009 03:13:36 -0700 (PDT), Nick Timkovich prometheus...@gmail.com wrote: On Mar 21, 9:19 pm, Jean-Paul Calderone exar...@divmod.com wrote: On Sat, 21 Mar 2009 13:52:21 -0700 (PDT), Nick Timkovich prometheus...@gmail.com wrote: I've been working on a program that will talk to an

Re: Async serial communication/threads sharing data

2009-03-22 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: It's true that the serial port support in Twisted isn't the most used feature. :) These days, serial ports are on the way out, I think. That said, much of the way a serial port is used in Twisted is the same as the way a TCP connection is

Re: Async serial communication/threads sharing data

2009-03-22 Thread Jean-Paul Calderone
On Sun, 22 Mar 2009 12:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: [snip] I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. By that I mean I could pump data into a 9600 baud serial

Async serial communication/threads sharing data

2009-03-21 Thread Nick Timkovich
I've been working on a program that will talk to an embedded device over the serial port, using some basic binary communications with messages 4-10 bytes long or so. Most of the nuts and bolts problems I've been able to solve, and have learned a little about the threading library to avoid

Re: Async serial communication/threads sharing data

2009-03-21 Thread Paul Rubin
Nick Timkovich prometheus...@gmail.com writes: My main issue is with how to exchange data between different threads; can I just do something like have a global list of messages, appending, modifying, and removing as needed? Does the threading.Lock object just prevent every other thread from

Re: Async serial communication/threads sharing data

2009-03-21 Thread Scott David Daniels
Nick Timkovich wrote: I've been working on a program that will talk to an embedded device over the serial port, using some basic binary communications with messages 4-10 bytes long or so... Ultimately, this program ... [send] messages and collecting responses for 10k-100k cycles ... Here's a

Re: Async serial communication/threads sharing data

2009-03-21 Thread Jean-Paul Calderone
On Sat, 21 Mar 2009 13:52:21 -0700 (PDT), Nick Timkovich prometheus...@gmail.com wrote: I've been working on a program that will talk to an embedded device over the serial port, using some basic binary communications with messages 4-10 bytes long or so. Most of the nuts and bolts problems I've