[PD] tcpserver, flush?

Christof Ressi info at christofressi.com
Mon Jun 15 21:07:37 CEST 2020


> I have revised the code in those objects
I see some bug fixes and the REUSEADDR and NODELAY options, that's cool!

If you have lots of free time, you also might want to revise the whole 
threading code. Spawning a new thread for every list of bytes is not 
only excessively wasteful (especially in a soft-realtime environment), 
but also breaks determinism: if you send list A and list B in short 
succession, thread A is not guaranteed to call "send()" before thread B, 
so bytes might arrive out of order on the other side. Instead push the 
bytes to a ringbuffer (preferrably lockfree) and let a *single* sender 
thread consume it.

Christof

On 15.06.2020 19:46, Martin Peach wrote:
> On Mon, Jun 15, 2020 at 12:32 PM Christof Ressi <info at christofressi.com> wrote:
>
>> I've said this elsewhere: as much as I like (and use) the mrpeach library, I avoid the net objects (especially [tcpclient] and [tcpserver]) because there are too many problems in the code. [iemnet], on the other hand, has been (re)written and maintained by actual domain experts.
> I have revised the code in those objects and just uploaded the whole
> mrpeach for Windows10 to deken. (this includes fixes to tcpserver and
> tcpclient as well as midifile) So anyway I have lots of free time now
> and I am maintaining the library, in the sourceforge svn repo
> (https://sourceforge.net/p/pure-data/svn/HEAD/tree/trunk/externals/mrpeach/).
> If there were a git repo for externals I would use that but it seems
> scattered at the moment.
>
> Martin





More information about the Pd-list mailing list