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

Make framecache pickleable #732

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

ChristosT
Copy link
Collaborator

@ChristosT ChristosT commented Nov 25, 2024

The multiprocessing library uses pickle to serialize objects between processes. This
was creating an issue for FrameCacheImageSeries since it contained a non-pickleable attribute.
We now skip this from the state. This should not affect the functionality of the framecache since
it was used to make sure that only one thread was populating the cache at a time. The same is true
now. In every process only one thread at a time can populate the cache

Fixes: #731

The multiprocessing library uses pickle to serialize objects between processes. This
was creating an issue for FrameCacheImageSeries since it contained a non-pickable attribute.
We now skip this from the state. This should not affect the functionality of the framecache since
it was used to make sure that only one thread was populating the cache at a time. The same is true
now. In every process only one thread at a time can populate the cache
@pep8speaks
Copy link

pep8speaks commented Nov 25, 2024

Hello @ChristosT! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-25 17:25:25 UTC

@ChristosT ChristosT force-pushed the make-framecache-pickleable branch 2 times, most recently from 4dd53aa to cffd506 Compare November 25, 2024 16:27
@ChristosT ChristosT requested a review from psavery November 25, 2024 16:35
from hexrd import imageseries


class ImageSeriesPickableTest(unittest.TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
class ImageSeriesPickableTest(unittest.TestCase):
class ImageSeriesPickleableTest(unittest.TestCase):

Slight naming issue.

@ChristosT ChristosT force-pushed the make-framecache-pickleable branch from cffd506 to ef025a3 Compare November 25, 2024 17:25
@psavery psavery merged commit 9e6fc2e into HEXRD:master Nov 25, 2024
6 checks passed
@ChristosT ChristosT deleted the make-framecache-pickleable branch November 25, 2024 21:26
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.

example problem not working: NIST_ruby/multiruby_dexelas/
3 participants