<div dir="ltr">The same question that I posted on bugtracker:<br><br>Linux, BSD, Unix, has another threaddriver than cthreads? If no, why not make cthreads unit the default threaddriver for Unix?<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-07-25 7:33 GMT-03:00 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
<br>
On Fri, 25 Jul 2014, Mark Morgan Lloyd wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Michael Van Canneyt wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, 25 Jul 2014, Juha Manninen wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I was asked why a threaded application compiles on Linux without "uses<br>
cthreads" but it does not work.<br>
cthreads must _always_ be added to uses section.<br>
I had no answer to that. IMO such errors should be trapped at<br>
compile-time, not at run-time.<br>
Could it be fixed somehow?<br>
</blockquote>
<br>
No, because there is no way to detect that threads are actually used in the program.<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I will add a remark in the classes unit TThread class documentation, to make it even more obvious.<br>
</blockquote>
<br>
Is there scope for improving the error message?<br>
<br>
Is there a scenario in which a program that sometimes uses threads (e.g. if it realises it's being asked to do a big job which can be parallelised) could start without giving the error message? This would make the situation more serious, since it would require that the programmer did some /real/ testing before shipping his code :-)<br>
</blockquote>
<br></div>
Not sure what you mean.<br>
<br>
The error only appears if you call a function that relies on the threading manager, never at the start of the program. It's slightly more complicated than this, but it boils down to that.<br>
<br>
So the fact that the program started doesn't mean there won't be an error further down the line. But that is IMHO no different from many other programming errors, such as trying to save preferences in a file in a directory that doesn't exist. You should always test all cases.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Michael.</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.<u></u>org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/<u></u>cgi-bin/mailman/listinfo/fpc-<u></u>pascal</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>The best regards,<br><br>Fabio Luis Girardi<br>PascalSCADA Project<br><a href="http://sourceforge.net/projects/pascalscada" target="_blank">http://sourceforge.net/projects/pascalscada</a><br>
<a href="http://www.pascalscada.com" target="_blank">http://www.pascalscada.com</a>
</div>