From: <don...@is...> - 2003-08-05 14:02:00
|
Hoehle, Joerg-Cyril writes: > BTW, I believe simple streams has solutions to all this mess. I don't see simple-stream in the source. Is this something already in clisp? Where can I find it? > I recommend that you look into EXT:MAKE-BUFFERED-OUTPUT-STREAM. I see it. How is that related to tcp streams? I suppose not at all. (TCP is what I really care about most.) > It's character only, but I wrote a cookbook entry on faithful binary output (using make-encoding charset:iso-8859-1 :line-terminator :unix). Where is this cookbook? > The buffer-flush function there could call linux:write() and throw out as much as a single OS write() can. Then buffer the rest for your socket select/poll() loop. > > Or you build a working abstraction based on controller- (deprecated) or Gray streams (both slow/high-overhead). > > That would be a cheap mean for experimenting, at the Lisp-level, viable low-level implementation path. Since I'm only trying to improve performance that seems off the critical path. > I've had ideas, but no time, about a > make-buffered-input|output-stream that would support binary instead > of character arrays. That would approximate unidirectional > non-seekable simple streams. But this would still have to be connected to TCP streams, right? So it seems to me that I probably have to start from the TCP code and work back toward stuff visible from lisp. > SETF stream-element-type of such a thing is yet to be defined > (esp. w.r.t. yet unflushed parts of a buffer of another element type). > The easy part of this would be copy&paste of the currently existing > character-based buffered-streams. The medium part revisiting some > listen/availablep return-codes. The hard part SETF-element. Not > supported (at first) would be setf-file-position. |