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

Add mutex to logger #1316

Merged
merged 1 commit into from Feb 17, 2018

Conversation

Projects
None yet
2 participants
@ddfreyne
Member

ddfreyne commented Feb 17, 2018

Fixes #1312.

God knows how to test this.

@ddfreyne ddfreyne merged commit d09c9b3 into master Feb 17, 2018

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@ddfreyne ddfreyne deleted the logger-mutex branch Feb 17, 2018

@Fjan

This comment has been minimized.

Show comment
Hide comment
@Fjan

Fjan Feb 17, 2018

Contributor

Thanks for the fix. However, adding a mutex is a lot heavier than simply using a print statement, which is atomic by itself.

Contributor

Fjan commented Feb 17, 2018

Thanks for the fix. However, adding a mutex is a lot heavier than simply using a print statement, which is atomic by itself.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Feb 17, 2018

Member

@Fjan I opted for a mutex for two reasons:

  1. I’d prefer not to rely on #print being atomic — it is not documented to be atomic, and not all Ruby implementations might implement #print atomically.

  2. Mutexes are so cheap that the slowdown of using mutex is unlikely to be noticeable.

Member

ddfreyne commented Feb 17, 2018

@Fjan I opted for a mutex for two reasons:

  1. I’d prefer not to rely on #print being atomic — it is not documented to be atomic, and not all Ruby implementations might implement #print atomically.

  2. Mutexes are so cheap that the slowdown of using mutex is unlikely to be noticeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment