-
-
Notifications
You must be signed in to change notification settings - Fork 741
A try to fix Issue 9606 #1179
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
A try to fix Issue 9606 #1179
Conversation
I'm not sure I understand what is going on here? Can you explain more detail? Also, |
|
Since a new signals is going to be put up for review sometime soon perhaps we should avoid adding these tricky changes? |
Going to close in ~ a week on the grounds of new std.signals being ready to go (pending results of voting). No point in half-fixing the broken module that has replacement. |
The new std.signals was rejected a few days ago. |
@JakobOvrum |
Aye, I don't know/care enough about |
@MartinNowak @Safety0ff @yebblies any thoughts on this? |
What exactly is the problem with finalizing objects during emit? |
If you're bug report is about the race condition of |
The problem is not working weak-ref implementation. My proposal is to add a slow but working weak-ref in this pull. Synchronize access to stuff is another issue I'm not going to deal with.
Why? We need objects being pinned and a GC fence anyay I don't see any better way to do it. |
Well, how about naming the issue exact issue first then? All I can read in the bug report and this pull request is very vague. |
As written in description, this is:
The entire code is so incorrect that trying to discover "exact issues" is harder than to rewrite it completely. The better solution is to add big reg it doesn't work! message in docs and deprecate the module as it can't really be used anyway. |
This is how cargo cult code is born. Please, if there is a race condition and you want simple fix, wrap a mutex around it. |
I'm not quite sure I understand what did you mean. I'll answer in case you meant my position is silly: At first sight addition of a mutext in |
Even if you had weak ref support, if the slots are meant to be accessed by multiple threads they need to be protected by a mutex. But a mutex should be sufficient, no need for the GC addRange stuff. Let's just fix this. |
I don't see any "accessed by multiple threads" in this module except what weak ref covers.
So good luck with that. I really have no idea how to implement what you propose. As one can see even my carefully written weak reference array implementation uses |
I see what your saying. I forgot, that finalizer are called when all threads are running again (after GC mark suspension). On adding weak reference support to druntime, I'm all for it, but we need to find good primitives that are portable to different GC implementations. All of this has been discussed in detail before. |
No. Threads are running but GC mutex is still locked until all finalizers are called, so |
Ah right, sorry for that. I should try to spend more time for reviews. |
Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=9606
A think-less fix just to prevent nasty random failures.