Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-02

Writeln in threads

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Jonas Maebe
to Ryan Joseph: Is writeln thread safe? I’m getting some strange crashes and I’m curious if they’re…
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 buffer flushes can interleave, but every thread gets its own copy of the standard IO buffer structures.

Jonas

Reply by email