Topic: with a principal flow.
After architecture reorganization on a real multithreading began to come up many bugs, here today at last it turned out to localize the main.
There is any action in one of flows, it is necessary to notify a principal flow (that any actions in a principal flow to fulfill, in a window something to make etc.) on it
Now it goes through a call, well here for example:
procedure TBaseCharacter. AddToSystemJournal (Value: String); ...Here we do everything that is necessary, including we create object SystemJournalData, and in the end - if CurrentThread. ThreadID <> MainThreadID then Queue (procedure begin EventOnSystemJournalAdded (Self, Value, SystemJournalData); end) else EventOnSystemJournalAdded (Self, Value, SystemJournalData);
It is logical that while it in a principal flow from queue gets yes will be fulfilled (flows can be much, and under some conditions, for example simultaneous connection - they will throw simultaneously in queue on synchronization a heap of calls) - Value already can be easily changed or is destroyed (EDoubleFreeError from Eureka - my favourite error).
Changed all Queue on Synchronize - a problem did not solve generally, only hardly it became more difficult to play back.
and different it is a lot of everyones, parameters all different. Simultaneously in queue two can rush identical so to do class variables too not a variant.
At me any unhealthy imaginations about class linked lists with for each parameter, and so on already begin.
Prompt, how this all business is correct is resolved?