about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-11-24 10:55:17 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-11-24 21:22:19 -0800
commit9fe8fc8836284643f13e148e3e8a09b643f3ff28 (patch)
tree019e6d9c264802e986c7082f53bd1d3d9e7bee6a /src/libsyntax/parse/parser.rs
parent01b53817033ba3a3ec01685d30e4a8e7ce14ba0c (diff)
downloadrust-9fe8fc8836284643f13e148e3e8a09b643f3ff28.tar.gz
rust-9fe8fc8836284643f13e148e3e8a09b643f3ff28.zip
Cache a task's stderr logger
This is both useful for performance (otherwise logging is unbuffered), but also
useful for correctness. Because when a task is destroyed we can't block the task
waiting for the logger to close, loggers are opened with a 'CloseAsynchronously'
specification. This causes libuv do defer the call to close() until the next
turn of the event loop.

If you spin in a tight loop around printing, you never yield control back to the
libuv event loop, meaning that you simply enqueue a large number of close
requests but nothing is actually closed. This queue ends up never getting
closed, meaning that if you keep trying to create handles one will eventually
fail, which the runtime will attempt to print the failure, causing mass
destruction.

Caching will provide better performance as well as prevent creation of too many
handles.

Closes #10626
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
0 files changed, 0 insertions, 0 deletions