<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
На 25.11.2010 12:39, Marco van de Voort напісаў(ла):
<blockquote cite="mid:20101125103944.4F07A1715A@turtle.stack.nl"
type="cite">
<pre wrap="">In our previous episode, Anton Kavalenka said:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">On 25 Nov 2010, at 10:52, Anton Kavalenka wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Due to incompatibility of RTL between FPC and Delphi my capturing
tricks not work.
BTW what the real reason to make these files as threadvar?
</pre>
</blockquote>
<pre wrap="">
To prevent multiple threads writing to stdin/stdout/sterr at the same
time from corrupting each other's data (all of these text files use an
internal buffer, even when the output is immediately flushed afterwards).
</pre>
</blockquote>
<pre wrap="">
lock_output();
try
// do something nasty with the buffer
finally
flush(output);
unlock_output();
end;
There is NO other runtimes on this planet instead FPC RTL which take
care of per-thread buffer of output.
It is programmers duty to lock/flush buffer in multithreaded environments.
</pre>
</blockquote>
<pre wrap="">
Such solutions are fine for slow apps, but in a fast pace, app, this means
that the logging with its locks has a significant impact on the behaviour of
the application.
And IMHO the RTL should be workable for all kinds of apps.
_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<font face="Helvetica, Arial, sans-serif">OK, let's replace threadvar
for those variables with var.<br>
<br>
regards,<br>
Anton </font><br>
</body>
</html>