<div>Dimitris,</div><div><br></div><div>More re f):</div><div><br></div><div>Wait, since internally the respective port does all the decoding logics anyhow, then the fact that Gambit internally signals IO events using mutex-based condvars should *not* affect the potential IO speed achievable, as the port internally could do read-ahead at the level of u8vector and the threadsafety-condvar stuff could work at that level;</div>

<div><br></div><div>Then, the read-u8:s could be made thread-unsafely without any need for condvars ever.</div><div><br></div><div>At least this understanding makes clear that independent of how Gambit's IO works internally, read-u8 and friends *can* be invoked completely without need by far for locking on a per-invocation basis, but rather once per block, so that would be once per 10240 calls or alike - very fair!. Though,</div>

<div><br></div><div>Only in case this could be done in such a way that it not interferes with hybrid binary & char access - that would be the only thing such a read-ahead mechanism could interfere with, wouldn't it? - it would be a 'complete' solution.</div>

<div><br></div><div>If you have any thoughts feel free to share.</div><div><br></div><div><br></div><div>Anyhow, for me the prios now are what's addressed by the parent email in this thread and points a) & b), as these are the things essential for driving realworld HTTP and HTTPS and alike reliably and cleanly.</div>

<div><br></div><div>Next thing after this would probably be c) & d) as to make the IO system abstract for this kind of uses. (As in, ability to implement protocol handlers for SSL etc. as Gambit ports in a way that delivers well.)</div>

<div><br></div>Brgds<div><br><div class="gmail_quote">2013/3/11 Mikael<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Hi Dimitris,<br>

<div class="gmail_quote"><div><br></div><div>Thank you for your response.</div><div><br></div><div>Feel most free to send it to the Gambit ML too, as to encourage further conversation on this topic.</div><div>
<br></div><div><br></div><div>
The IO performance can be boosted to really good performance by doing it via read/write-subu8vector only, but that has huge system-level limitations so even though for almost-all applications that can solve it, in the big picture it's not a solution.</div>



<div><br></div><div>Re boosting byte-level access speeds, I remember I think Marc making a ML post where he inlined read-char's or read-u8's code in the user code and got much higher performance that way. That saves of the trampoline call at least... It should be easy to repeat that experiment as to check out how it affects performance.</div>



<div><br></div><div>Condition variables... Hmm. Do you have any clue at what granularity they work?</div><div><br></div><div><br></div><div>Brgds :) Mikael</div><div><div><div><br><div class="gmail_quote">
2013/3/10 Dimitris Vyzovitis <span dir="ltr"><<a href="mailto:vyzo@hackzen.org" target="_blank">vyzo@hackzen.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+1<br>
<br>
If I may add, point (f) should be a priority. i/o performance is<br>
severely hampered by the constant mutex acquisitions.<br>
At a  first approximation, each individual write should stop writing<br>
one character at a time (with a mutex lock each time).<br>
Having full control of whether a mutex is used at all is even better,<br>
as it is almost always the case that a single thread is<br>
reading/writing a port (exceptions being the std ports). The problem<br>
there is the way the i/o system i simplemented though, as the events<br>
are tied to condition variables and these in turn tied to mutexes to<br>
work reliably.<br>
<br>
PS: I owe you some coroutines :)<br>
<div><div><br></div></div></blockquote><div> </div></div></div></div></div></div>
</div></div></blockquote></div><br></div>