-
Notifications
You must be signed in to change notification settings - Fork 268
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
Non-Thread Safe Property Injection #530
Comments
Yes, typhoon supposed to be threaded safe. It's guaranteed by wrapping all outside methods code into synchronized statement, so static inside should works. Отправлено с iPhone
|
Well, I believe that the following parallel code path is not safe. Thread 1 (Main)
Thread 2 (Background)
It seems that they are not under a common @synchronized. Let me know if you need further information. BR, |
Thank you for these details! I'll take a look later today then get back to you soon. Best Regards,
|
Sure. If you need more details, feel free to ask. |
@vitorhugomagalhaes what's Typhoon version you using? |
Hi, Version 3.2.8 , maybe a bit old ... Should I try the latest on ? Thanks, |
Hi, I've being using the latest version without any crash. Cannot confirm if it really solves the issue or not. Any feedback ? BR, |
Yes, I think there is still one issue in multi threading while using assembly interface. I will fix that asap. Unfortunately these kind of problems can't be covered by unit tests or easily replicated, so we can only analyze the code. (Btw. If you have demo which shows that crash - it would be helpful) Best Regards,
|
Hi, Demo is not easy. The project is quite big and it's difficult to isolate the specific code to replicate the behaviour. Thanks, |
Hi, Just wondering if you have the time to check this. Removing the static buffer seems to workaround. We will release to market next week so I'm bit short in time. If you don't approve the static keyword removal I'll probably fork this for our selfs right now. Any suggestion ? Thanks in advance, |
Hi @vitorhugomagalhaes. Yes, I'm still keeping this problem in mind, but I'm super busy these days. I found reason of problems above and know the solution. If you can make fork and PR with fix - that would be helpful a lot! So, the problem:
methods and so on.. But when we using assembly interface to build/access instances, The solution is:
Plus I agree with removing static buffer statement. This micro optimisation doesn't worth problems it lead. And good luck with the release, hope all goes well! |
I've changed the code as requested and submitted the PR. I'll be testing our fork during the next week. Hopefully it won't crash anymore :) BR, |
Non-Thread Safe Property Injection #530
Hi,
I've discovered a race condition when the property injection code is running in parallel.
My first question, and I'm afraid of the answer :), is Typhoon thread safe ?
The code causing the issue is in TyphoonIntrospectionUtils.m line 33.
static char buffer[256];
There is no reason to be static and this is the root cause for random crashes we are facing on our app.
If Typhoon is thread safe I'd be happy to remove the static keyword. Otherwise, I'm in trouble ...
Thanks in advance,
The text was updated successfully, but these errors were encountered: