Open BeRo1985 opened 3 weeks ago
@BeRo1985 thanks for proposing these changes. can you please create a PR containing these changes so the commit history contains your contributions?
@BeRo1985 please take a look at here
I used GlobalPasMP.ParallelFor
to handle the parallel processing and this worked as expected back then.
has something changed recently?
Nothing in PasMP has changed regarding this behavior; it has worked this way from the beginning. If the code worked for you previously, that would be due to luck đŸ™‚ , influenced by factors such as your specific hardware configuration, CPU load, and other runtime conditions. However, this usage does not guarantee correct parallel behavior across different environments, and it could easily lead to issues on other systems or under different conditions.
And you only have to call TPasMP.CreateGlobalInstance;
once, for example somewhere within the unit initialization ... end.
block, or somewhere where it is only executed once. Otherwise, only unnecessary CPU cycles would be wasted.
Thanks @BeRo1985 for the explanation. Will look into it.
Issue
I've noticed that this project misuses the PasMP library (which I am the author of) in parallel loop handling, which could lead to incorrect behavior in multithreaded operations. Specifically, the parallel loop wrappers are only processing the starting index (
AFromIndex
) without iterating through the full range (AFromIndex
toAToIndex
). Here are the corrections:Corrections
In
TBlake2BP.PasMPParallelComputationWrapper
:Current:
Corrected:
In
TPBKDF_ScryptNotBuildInAdapter.PasMPSMixWrapper
:Current:
Corrected:
In
TPBKDF_Argon2NotBuildInAdapter.PasMPFillMemoryBlocksWrapper
:Current:
Corrected:
Summary
These changes ensure that all indices within the given range are processed correctly, maintaining the intended parallelization behavior.