Re: Tcl_Ungets help [long, technical]?



In article <3qmdnflSGdI0W8zZRVn-sg@xxxxxxxxxxx>,
David Gravereaux <davygrvy@xxxxxxxxx> wrote:
MH wrote:
Anyone know when/where the bug was fixed? Any patches available?

That might have been a fix I committed. Try doing a text search on the
ChangeLog file (and yearly splits) for Tcl_Ungets to find the change
notices done to it.


Well, you do definitely have a patch there!

2004-02-02 David Gravereaux <davygrvy@xxxxxxxxx>

* generic/tclIO.c (Tcl_Ungets): fixes improper filling of the
channel buffer. [Bug 405995]

Now, for the $64,000 question: what version was the patch against? Someone
here is loath to switch from 8.4.4, because we'd need a lot of
re-validation, etc..

Can this patch be retrofitted into 8.4.4?


IMHO, I think your code would be much more portable if you stayed with the
Tcl API for managing the stream rather than directly using the OS handle.

Understood. I'm not sure if our sending end is up to the maximum speed
the receiving end can handle, but even then, just with this change, we saw a
speedup of 2.3X in terms of sending data over a network. In theory, it can
be more than that (I think we're seeing the producer starve the consumer
now)..

2.3X (maybe more) is worth it - our primary platform is Linux. And, the
"slower" code is fully interchangeable. So, for Windoze, just a quick
#ifdef, and we work there (2.x times slower).


IIRC, Donal or DKF gave me a wet noodle thrashing for committing an
untested change as there aren't any test suite procedures that exist for
the features of Tcl_Ungets as it's one of those APIs the core itself
doesn't make use of (like Tcl_AsyncMark).

Well, it seems to work now :-)

Mattias
.