computablee / DotMP

A collection of powerful abstractions for parallel programming in .NET with an OpenMP-like API.
https://computablee.github.io/DotMP/
GNU Lesser General Public License v2.1
29 stars 7 forks source link

Remove some dead code #50

Closed computablee closed 1 year ago

computablee commented 1 year ago

We should remove NotInSectionsRegionException and Parallel.__reset_lambda_memory.

NotInSectionsRegionException was used when the DotMP.Parallel.Section construct existed, but this function has been removed as of DotMP v1.4.0 in favor of a new API for sections. Therefore, the NotInSectionsRegionException is no longer needed or used. This is a super easy issue, we should just remove this from the codebase.

Parallel.__reset_lambda_memory was used when testing an old version of Parallel.Critical with a different API which, instead of taking an id parameter, it kept a hash of lambdas passed to it. This version was buggy as hashes of lambda functions are not guaranteed to be the same given identical source, so it was changed. This function can be removed.

Finally, Parallel.critical_lock can be refactored into being a Dictionary<int, object> instead of a Dictionary<int, (int, object)>. This is also legacy from the old Parallel.Critical syntax.

A PR should be a draft until all 3 of these issues are addressed.