Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock output to xoutput_buffer #319

Merged
merged 3 commits into from Mar 23, 2020
Merged

Lock output to xoutput_buffer #319

merged 3 commits into from Mar 23, 2020

Conversation

hahnjo
Copy link
Contributor

@hahnjo hahnjo commented Mar 23, 2020

C++11 guarantees that std::cout and std::cerr are safe to access from multiple threads. xeus-cling should provide the same semantics for the redirected streams.

To reduce the overhead of locking, implement xoutput_buffer::xsputn() which outputs a string of characters.

Jonas Hahnfeld added 3 commits Mar 23, 2020
This outputs a string of characters which can be appendded more
efficiently.
This is already implemented in interpreter::publish_{stdout,stderr}.
C++11 guarantees that std::cout and std::cerr are safe to access
from multiple threads. xeus-cling should provide the same semantics
for the redirected streams.
@SylvainCorlay
Copy link
Member

@SylvainCorlay SylvainCorlay commented Mar 23, 2020

Great! Merging.

@SylvainCorlay SylvainCorlay merged commit 9fb4a92 into jupyter-xeus:master Mar 23, 2020
2 checks passed
@hahnjo hahnjo deleted the input-lock branch Mar 23, 2020
fengjixuchui added a commit to fengjixuchui/xeus-cling that referenced this issue Mar 23, 2020
Merge pull request jupyter-xeus#319 from hahnjo/input-lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants