-
Notifications
You must be signed in to change notification settings - Fork 176
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
JBR-6696: hardened MTLGC_DestroyMTLGraphicsConfig #301
Conversation
Will fix PR asap |
0974599
to
930b21d
Compare
Did you check for freezes that happened with the previous version? |
Yes I am testing my patch ... |
(WIP) tests in progress... |
@@ -39,6 +39,10 @@ | |||
// scenarios with multiple subsequent updates. | |||
#define KEEP_ALIVE_COUNT 4 | |||
|
|||
// Min interval between 2 display link callbacks (Main thread may be blocked) | |||
// ~ 2ms (shorter than 240Hz frame time) | |||
#define KEEP_ALIVE_MIN_INTERVAL 2.0 / 1000.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rephrase it in terms of FPS because it seems to better describe this restriction. Something like
#define MAX_FPS 240
#define KEEP_ALIVE_MIN_INTERVAL 1.0/MAX_FPS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems possible to query monitor capabilities at runtime on recent macos, so yes, max_freq or fps is important as new monitors can achieve 480hz...
Here I just want to discard old callbacks ... postponed by busy main thread, then flushed at once...
Will look at cvtime ...
201cf0e
to
983c213
Compare
3f6c074
to
e0c14e8
Compare
setenv("MTC_PRINT_SELECTOR_STATS", "1", 1); | ||
} | ||
|
||
void *result = dlopen("/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to provide the path via JVM option
timebase = malloc(sizeof (mach_timebase_info_data_t)); | ||
mach_timebase_info(timebase); | ||
|
||
printf("timebase->numer: %d\n", timebase->numer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to use J2D runtime trace here (J2dRls...)
} else { | ||
if (wait && isEventDispatchThread()) { | ||
void (^blockCopy)(void) = Block_copy(^(){ | ||
if (!DECORATE_MAIN_THREAD) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use DECORATE_MAIN_THREAD as a macro so it's better to replace the if statement with the preprocessor IF or maybe enable it always in DEBUG mode.
e1b7ca0
to
5c43c86
Compare
b3b1377
to
a6fe7bb
Compare
e8b69a5
to
9645dea
Compare
325d861
to
336e761
Compare
43cd62c
to
e6c6afc
Compare
New PR opened: #383 |
5a08a7a
to
8934056
Compare
to ensure any aync callbacks are performed before deallocation, added CVDisplayLink checks, traces and refactored cleanup code + fixed review comments