[AD] Text Log Window - implementation issue

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Sorry for double posting if you received similar message yesterday. My
primary mail address refuse to work with SF lists, so I'm switching to
gmail address.
Michał Cichoń


I found current implementation of text log window... disturbing. ; )

As far as I understand now text is placed into the buffer and sent
away. Every next call to logging routine will be ignored until buffer
content will be flushed. IMHO this isn't acceptable solution. We are
loosing information in the process.

I think this will be better to perform locking in
al_append_native_text_log() in the form it was there before. This
guarantee correct output.

I remember performance considerations. I think we can optimize logging
using circular buffer which will be filled by
al_append_native_text_log(). Writing into should be protected by lock,
reading do not require one. One pointer will control reading point,
one will control writing point. Every call to
al_append_native_text_log() will put text at the writing point in the
buffer. If there is no place in the buffer lock have to be performed
until buffer is freed.

With this solution no message will be ever lost and
al_append_native_text_log() will usually be quick.

What do you think about this, well... fix idea. I guess missing/broken
messages may be considered as bug.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/