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

Flush Cell cache when we run out. #33

Merged
merged 2 commits into from
Dec 15, 2020
Merged

Flush Cell cache when we run out. #33

merged 2 commits into from
Dec 15, 2020

Conversation

abellgithub
Copy link
Collaborator

No description provided.

{
std::unique_lock<std::mutex> lock(m_mutex);
if (nonblock && m_buffers.empty() && m_count >= MaxBuffers)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this buffers.empty() check be locked?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably. Thx.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, no. Or to put it another way, it already is.

The lock that was in the BufferCache has been removed. The lock that's used is now the one that's in the Writer, that owns the buffer cache. Writer::fetchBuffer() acquires the lock before calling BufferCache::fetch(). It passes the lock along so that it can be UN-locked if we need to wait on a CV.

bu/Processor.cpp Outdated Show resolved Hide resolved
epf/FileProcessor.cpp Outdated Show resolved Hide resolved
@abellgithub abellgithub merged commit 90d210b into main Dec 15, 2020
@abellgithub abellgithub deleted the issue-32 branch December 16, 2020 23:52
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