[gstreamer-bugs] [Bug 517231] threadsafe/colored windows logging

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Apr 7 11:19:37 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=517231

  GStreamer | gstreamer (core) | Ver: git




------- Comment #11 from LRN  2009-04-07 18:20 UTC -------
Another option is to use WriteConsoleOutput() function, which takes combined
character and attribute (color) data. But there is one problem with it - it
won't change the cursor position. So we'll have to change it manually. Which
means calling GetConsoleCursorInfo() to get current cursor position and
SetConsoleCursorPosition() to change it.

It's still not thread-safe. On the other hand, if we DO use locking, this
solution offers shortest locktime, because character/color buffer is prepared
outside of lock, function locks only to write data into the console and move
the cursor, which should be faster than writing a string and changing color
attribute a few times (current solution) or writing one string and then setting
console attributes a few times (the FillConsoleOutputAttribute solution).

FillConsoleOutputAttribute has an advantage of writing meaningful text data in
both implementations (with or without locking), because the presence of a lock
only affects the way it colorizes text (it may colorize wrong characters in
concurrent mode, but at least text will be intact).


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=517231.




More information about the Gstreamer-bugs mailing list