[fpc-pascal]Crashes with multithreading

Michael Van Canneyt michael.vancanneyt at wisa.be
Thu Dec 14 16:43:38 CET 2000

On Thu, 14 Dec 2000, Andrey Kubyshev wrote:

> 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.

Send me all information you have, preferably with a test program.

I'll have a look at it; I implemented the cmem unit...


More information about the fpc-pascal mailing list