Forum: Ruby-core warn and puts should be atomic

C042517d59bed4761cc88681bf71fca8?d=identicon&s=25 unknown (Guest)
on 2014-02-15 06:47
(Received via mailing list)
Issue #9420 has been updated by Masaki Matsushita.

Assignee set to Masaki Matsushita

----------------------------------------
Feature #9420: warn and puts should be atomic
https://bugs.ruby-lang.org/issues/9420#change-45170

* Author: Eric Wong
* Status: Open
* Priority: Low
* Assignee: Masaki Matsushita
* Category: core
* Target version: current: 2.2.0
----------------------------------------
Since we added use of writev in r44618, we should make warn/puts atomic.
It would make development of multiprocess/multithreaded processes
easier,
I think it was intended to be atomic based on old comments in io.c:

```
-       /*
-        * xxx: use writev to avoid double write if available
-        * writev may help avoid context switch between "a" and "\n" in
-        * STDERR.puts "a" [ruby-dev:25080] (rebroken since native
threads
-        * introduced in 1.9)
-        */
```
This topic is locked and can not be replied to.