[PD] tcpserver, flush?

Martin Peach chakekatzil at gmail.com
Mon Jun 15 21:41:35 CEST 2020


On Mon, Jun 15, 2020 at 3:09 PM Christof Ressi <info at christofressi.com> wrote:
>
> > 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.
>

Yes, that's next. I first wanted to see if I have stopped the crashes
that seemed to be due to non-threadsafe calls. The one crash report
I've seen shows it occurring inside Pd's main event loop because of a
call to clockdelay from another thread while Pd is manipulating the
same clock. If it works, It's nearly ready to move to a single thread,
I already use a thread to receive and check for completed sends.
Should be ready by next week :)
.


Martin



> 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
>
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list





More information about the Pd-list mailing list