Re: [fpc-pascal] Writeln in threads

2017-02-17 Thread Jonas Maebe
On 17/02/17 12:43, Ryan Joseph wrote: Is writeln thread safe? I’m getting some strange crashes and I’m curious if they’re related to calling writeln on multiple threads. Unlikely. The output from different threads can be mixed at weird places since it all goes to the same file handle and buff

Re: [fpc-pascal] Writeln in threads

2017-02-17 Thread fredvs
> Is writeln thread safe? In console application, IMHO yes. But If you use writeln in a Windows environnement or with LCL widget, it could not be safe. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Writeln-in-threads-tp5727683p5

[fpc-pascal] Writeln in threads

2017-02-17 Thread Ryan Joseph
Is writeln thread safe? I’m getting some strange crashes and I’m curious if they’re related to calling writeln on multiple threads. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi

Re: [fpc-pascal] writeln in threads on linuxt

2006-07-03 Thread Marco van de Voort
> > 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. Even then it won't necessarily work. textrec threadvar prob

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

2006-07-02 Thread Ole J. Røtne
> Please post the complete code. Here goes (Typed from my Linux box, as i don't have filesharing going there): < Start Unit1 Unit unit1; {$mode objfpc}{$H+} Interface Uses Classes, SysUtils; Type threadtest = class(tthread) constructor Create; procedure Execute: override; End

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

2006-07-02 Thread Graeme Geldenhuys
Could we see the complete code please... Graeme. On 7/2/06, Ole J. Røtne <[EMAIL PROTECTED]> wrote: Did try to wrap both of the WriteLn() with EnterCriticalSection/LeaveCriticalSection. Same result.. -- There's no place like 127.0.0.1 ___ fpc-pasc

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

2006-07-02 Thread Florian Klaempfl
Ole J. Røtne wrote: > > >> -Opprinnelig melding- >> Fra: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] På vegne av >> Florian Klaempfl >> Sendt: 2. juli 2006 12:46 >> Til: FPC-Pascal users discussions >> Emne: Re: [fpc-pascal] wri

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

2006-07-02 Thread Ole J. Røtne
> -Opprinnelig melding- > Fra: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] 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 &

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

2006-07-02 Thread Florian Klaempfl
Ole J. Røtne wrote: > > Can anyone explain why i get output like this in a small test program: > Inside Thread >Main Loop > Inside Thread >Main Loop > Inside Thread >Main Loop > > > On Windows the output are lined up just as I would expect: > Insi

[fpc-pascal] writeln in threads on linux

2006-07-02 Thread Ole J. Røtne
Can anyone explain why i get output like this in a small test program: Inside Thread Main Loop Inside Thread Main Loop Inside Thread Main Loop On Windows the output are lined up just as I would expect: Inside Thread Main Loop Inside Thread Main