Skip to content

Conversation

@saiprasad578
Copy link

This PR resolves Issue #76 by implementing a robust SingletonBase metaclass in patcher.py. This implementation specifically addresses the "segmentation violations" mentioned in the issue notes by providing fork-safety for parallel execution.

Technical Implementation :

  1. Double-Checked Locking: Implemented a thread-safe call method using threading.Lock. It uses a double-check pattern to ensure high performance.
  2. Fork-Safety Handler: Added os.register_at_fork to re-initialize the lock in child processes. This prevents deadlocks in multi-processing/HPC environments.

Verification Results :
I have rigorously verified this fix with a stress test:
Test Setup: 20 concurrent threads simultaneously requesting the Singleton instance.
Result: SUCCESS. All 20 threads returned the exact same memory ID, confirming zero race conditions.
Verified Screenshot:
Screenshot 2025-12-17 162059

CLA Status: I have already submitted my signed 52°North Contributor License Agreement (CLA) via email.

@kdemmich
Copy link
Collaborator

kdemmich commented Jan 7, 2026

Hi @saiprasad578, thank you for your PR. We appreciate the time and effort that was put into it but, unfortunately, we have to decline the PR as docstrings and log messages have been deleted and several minor reformulations blur the true contribution.

@kdemmich kdemmich closed this Jan 7, 2026
@saiprasad578
Copy link
Author

saiprasad578 commented Jan 7, 2026

Thank you for reviewing my code , I really want to work on this issue.
Can you give some more details about the issue so that I will try again and perform my level best.
Or can you suggest me any issues that I can contribute !
@kdemmich

@kdemmich
Copy link
Collaborator

kdemmich commented Jan 7, 2026

@saiprasad578 We appreciate your enthusiasm to contribute to the WRT. As we state in our contribution guidelines, we do not assign tickets to contributors we have not yet worked with. You're of course welcome to submit PRs to available tickets anyway. Unfortunately, we currently do not see any available tickets that are suitable for WRT beginners.

@saiprasad578
Copy link
Author

Thank you for replying me !! I understood,I will try my level best to contribute to WRT.
I hope i will find a good real time issue to contribute in feature and I am aiming to contribute under GSOC' 26 also
Thank you for your valuable time. @kdemmich

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.

2 participants