[fpc-pascal]Crashes with multithreading

Andrey Kubyshev email at vtc.ru
Thu Dec 14 14:00:28 CET 2000


Hello,

Jonas> FPC's heap manager and IO functions (writeln/readln) are *not* thread
Jonas> safe. That's probably what's causing the crashes. Add the cmem unit (from 
Jonas> the "packages" units) as the first unit in your "uses" clause, then 
Jonas> you're at least safe on the memory management side. You can't use heaptrc 
Jonas> with it though.

I was trying to apply CMEM unit to my small example with pthreads, and
had following : if i set cmem before pthreads unit it crashes on
program initialization before my code executed, if i put cmem after ,
all works good except that, now its crashes in finalization stage,
after my code already executed. But in bigger project which i need to
run it doesnt matter where i put it, it crashes at start anyways.
Who can give advice how to fix it please ? I can show strace logs
where it happens.

-- 
Best regards,
Kubyshev Andrey                            mailto:email at vtc.ru






More information about the fpc-pascal mailing list