<!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:01, Jonas Maebe напісаў(ла):
<blockquote
cite="mid:343046C2-3F1B-469D-A570-51CB54128755@elis.ugent.be"
type="cite"><br>
On 25 Nov 2010, at 10:52, Anton Kavalenka wrote:
<br>
<br>
<blockquote type="cite">Due to incompatibility of RTL between FPC and
Delphi my capturing tricks not work.
<br>
BTW what the real reason to make these files as threadvar?
<br>
</blockquote>
<br>
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).
<br>
<br>
<br>
Jonas
<br>
<br>
<br>
_______________________________________________
<br>
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
<br>
</blockquote>
<font face="Helvetica, Arial, sans-serif">Is not the better way to use
something like this:<br>
<br>
lock_output();<br>
try<br>
// do something nasty with the buffer<br>
finally<br>
flush(output);<br>
unlock_output();<br>
end;<br>
<br>
There is NO other runtimes on this planet instead FPC RTL which take
care of per-thread buffer of output.<br>
It is programmers duty to lock/flush buffer in multithreaded
environments.<br>
<br>
If FPC wants to be so nice - let's introduce critical section in output
structure. <br>
Any outputs would be suspended until a thread acquires it by write
operation.<br>
<br>
regards,<br>
Anton<br>
</font>
</body>
</html>