Igor Marnat wrote:
As I have already read in archives, thread support in GPC is missing now. I know that I can "feel free to implement it myself" but, unfortunately, I am rather a compiler user than a creator, I'm not a such guru (at least, for the time being).
The good news is that most critical part are in the RTS which is more or less normal Pascal (mostly) and C (a bit) code. Just look for global variables etc. there.
As far as I know, one of the potential damages with multithreaded programs written in GPC is working with files, isn't it?
Yes, that's one global variable (_p_FDRList) that's only used in open/close operations (and perhaps a few more). The file structures itself should be no problem (unless two threads access the same file at once, but that's the same problem for every variable; and unless the OS itself is not thread-safe WRT files, but this shouldn't be a problem today I suppose ;-).
Would you please clarify me other issues (potential damages) of such kind to avoid them from the program or at least to know about them? I mean such kinds of activity which use global (system) variables that are not synchronized, etc.
I haven't looked into it, but if it's easy to add synchronization code to the RTS without making it *dependent* on threads, as you said, feel free to do it. :-)
Frank