Skip to content

Conversation

asfernandes
Copy link
Member

No description provided.

@asfernandes asfernandes force-pushed the work/lockmanager-decouple branch 2 times, most recently from 14610d6 to f63d26e Compare August 28, 2025 01:41
{
}

ISC_STATUS getCancelState() const override;
Copy link
Contributor

Choose a reason for hiding this comment

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

If the class is marked final, perhaps it would be better to mark the methods final as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

That can be inferred by the compiler.

@aafemt
Copy link
Contributor

aafemt commented Aug 28, 2025

Can templates be used here instead of callback parameter to resolve interface at compiler-time instead of run-time?

@asfernandes
Copy link
Member Author

Can templates be used here instead of callback parameter to resolve interface at compiler-time instead of run-time?

First, show numbers of what is the performance penalty introduced.

@hvlad
Copy link
Member

hvlad commented Aug 28, 2025

Can templates be used here instead of callback parameter to resolve interface at compiler-time instead of run-time?

No.

@asfernandes
Copy link
Member Author

I don't know what's happening with the android build. Maybe a compiler issue with the host machine compiler. This first phase seems to work locally.

@hvlad
Copy link
Member

hvlad commented Aug 28, 2025

I don't know what's happening with the android build. Maybe a compiler issue with the host machine compiler. This first phase seems to work locally.

Is it possible to produce stack backtrace at the compiler host and extract it from there for analysis ?

@hvlad
Copy link
Member

hvlad commented Aug 28, 2025

Is it possible to produce stack backtrace at the compiler host and extract it from there for analysis ?

Sorry, I wrongly thought it is an engine crashed. Actually, it is clang compiler... weird

@asfernandes asfernandes force-pushed the work/lockmanager-decouple branch from f63d26e to 3e428e3 Compare August 28, 2025 10:54
@asfernandes
Copy link
Member Author

Is it possible to produce stack backtrace at the compiler host and extract it from there for analysis ?

Sorry, I wrongly thought it is an engine crashed. Actually, it is clang compiler... weird

Trying NDK update.

@asfernandes
Copy link
Member Author

Is it possible to produce stack backtrace at the compiler host and extract it from there for analysis ?

Sorry, I wrongly thought it is an engine crashed. Actually, it is clang compiler... weird

I think it's not clang (NDK), but GPRE running that is causing the problem. That's why make deletes temp/Release/burp/OdsDetection.cpp.
I'm now trying to update the runners so the host x64 compiler is upgraded.


ULONG adjustWait(ULONG wait) const
{
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return 0;
return wait;

@TreeHunter9
Copy link
Contributor

Can templates be used here instead of callback parameter to resolve interface at compiler-time instead of run-time?

I guess templates can be used here by converting this whole thing to header only, which is definitely not worth it, and performance increase here will be non-existent due to other heavy work being done in functions, so overhead of virtual calls would be >0.1%.
And Adriano is right, for this macro optimization, measurements need to be done first.

threads.emplace_back([&]() {
const UCHAR LOCK_KEY[] = {'1'};
FbLocalStatus statusVector;
LOCK_OWNER_T ownerId = threadNum + 1;
Copy link
Member

Choose a reason for hiding this comment

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

Here many threads could see the same value of threadNum, in my case all threads sees value 8.
Using an separate atomic_int to generate ownerId and test passed.

Copy link
Contributor

@TreeHunter9 TreeHunter9 Aug 28, 2025

Choose a reason for hiding this comment

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

I think the idea was to take threadNum from the loop, and this single loop will increment threadNum, so no race should be here, but it was captured by reference, so yea, it lead to race condition. I guess capture threadNum by value will fix the issue, without atomics.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes @TreeHunter9 . Thanks for catching this, @hvlad and sorry for the noise. It seems to work as well in Linux. I will improve this test and make others.

@asfernandes asfernandes force-pushed the work/lockmanager-decouple branch from 3d18860 to 74ed413 Compare August 29, 2025 00:42
@hvlad
Copy link
Member

hvlad commented Aug 29, 2025

The crash on Android build makes me to ask - why it is different from other platforms ?
I.e. why it run blocking action in single process ?
Or are there more than a single process accessing same database ?
Another (previous) gpre instance ?

@asfernandes
Copy link
Member Author

The crash initially didn't happened when I removed parallel make (-j4). I caught the problem in the core dump.
But all platforms are using parallel make.

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.

5 participants