[fpc-pascal]Crashes with multithreading

Jonas Maebe jonas at zeus.rug.ac.be
Mon Dec 11 16:00:38 CET 2000


>it leak 536 bytes. Becouse i think that my web server (based on
>pthreads) crashes coz of invisible memory leaks. I compiled this
>example with latest official version 1.0.2 and latest sources from
>CSV. I choosed pthreads becouse to complitely free memory in fpc i
>must call .Destroy, but i cant call it from inside thread. So , with

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


Jonas




More information about the fpc-pascal mailing list