SV: [fpc-pascal] writeln in threads on linux

Ole J. Røtne ole.rotne at online.no
Sun Jul 2 16:32:36 CEST 2006


 

> -----Opprinnelig melding-----
> Fra: fpc-pascal-bounces at lists.freepascal.org 
> [mailto:fpc-pascal-bounces at lists.freepascal.org] På vegne av 
> Florian Klaempfl
> Sendt: 2. juli 2006 12:46
> Til: FPC-Pascal users discussions
> Emne: Re: [fpc-pascal] writeln in threads on linux
> 
> > And if this is a "wrong way" of doing this thing, could 
> someone tell 
> > me how it should be..
> 
> You probably want to guard the output with mutexes or semaphores.
> Writing unsynchronized to a stream has always unexpected results.
> 

Did try to wrap both of the WriteLn() with
EnterCriticalSection/LeaveCriticalSection. 
Same result..

And to answer another post at the same time..

If I use: Writeln('.....', LineEnding);
I get the double lineshift thing all over again, same as using #13#10..

Inside Thread
	
		 Main Program

Inside Thread

And so on...

And as I said in my last post.

When the program terminates, the lineshift thing is still there.
Seem like something isn't cleared/reset at program termination..
If I press enter, the next prompt end up after the other. (no lineshift) 

Example:
olejr at linux-box:~/test> olejr at linux-box:~/test>




Ole JR




More information about the fpc-pascal mailing list