Skip to content

having a single Buffer in LoggerSet for locking #197

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

Merged
merged 2 commits into from
Sep 16, 2021
Merged

having a single Buffer in LoggerSet for locking #197

merged 2 commits into from
Sep 16, 2021

Conversation

kazu-yamamoto
Copy link
Owner

This should fix #196

@kazu-yamamoto
Copy link
Owner Author

@ruicc @khibino Would you review this PR?

Copy link

@khibino khibino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kazu-yamamoto
Copy link
Owner Author

@ruicc Are you OK with this PR?

@ruicc
Copy link

ruicc commented Sep 16, 2021

I will check behaviours..

Copy link

@ruicc ruicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking code and behaviours finished. LGTM!

pushLog :: IORef FD -> Logger -> LogStr -> IO ()
pushLog fdref logger@(Logger size mbuf ref) nlogmsg@(LogStr nlen nbuilder)
pushLog :: IORef FD -> BufSize -> MVar Buffer -> Logger -> LogStr -> IO ()
pushLog fdref size mbuf logger@(Logger ref) nlogmsg@(LogStr nlen nbuilder)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing is protected by the same MVar when message size is longer than buffer size. OK.

@kazu-yamamoto kazu-yamamoto merged commit cde8404 into master Sep 16, 2021
@kazu-yamamoto kazu-yamamoto deleted the lock branch September 16, 2021 22:59
@kazu-yamamoto
Copy link
Owner Author

Merged.
This should be version 3.1.0.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Feb 11, 2022
3.1.1
* More time-ordered logging functions
  [#199](kazu-yamamoto/logger#199

3.1.0
* Having a single Buffer in LoggerSet for locking
  [#197](kazu-yamamoto/logger#197. This would have
  performance penalty. So, the major version bumps up. If you see
  performance regression, please register an issue on github.
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.

3 participants