Skip to content
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

HTHREADS review/redesign/rewrite with Windows R/W lock support #34

Open
Fish-Git opened this issue Nov 27, 2017 · 0 comments
Open

HTHREADS review/redesign/rewrite with Windows R/W lock support #34

Fish-Git opened this issue Nov 27, 2017 · 0 comments
Labels
Enhancement This issue does not describe a problem but rather describes a suggested change or improvement. Related This issue is closely related to another issue. Consider this issue a "sub-issue" of the other.

Comments

@Fish-Git
Copy link
Member

Fish-Git commented Nov 27, 2017


Note: issue #112 "HTHREADS thread-priorities implementation appears BORKED" appears to be closely related to this one.


Significant enhancements to Hercules's lock handling has been done over the years (mostly for integrity/error-checking purposes), resulting in a likely inefficient design and implementation (based on looking at the code), thereby slowing down all of Hercules given how much it (or any multi-threaded program, really!) relies on locks for controlled access to shared resources.

A detailed review, redesign and potential complete rewrite appears to very likely be in order.

One thing that might possibly be done right away is to have separate debug and non-debug versions of all locking functions to eliminate the overhead that exists in the current design, which currently tries hard to catch locking errors (which as we all know are otherwise notoriously difficult to catch).

But the most important change that could probably be made is to implement RW locking support in Windows and then leverage RW locking in all of Hercules.

POSIX pthreads has long supported RW locks (pthread_rwlock... set of functions) but Windows only introduced "Slim Reader/Writer (SRW) Locks" starting with Windows Vista, and due to Windows XP being, at the time, our minimum supported platform, our hthreads implementation for Windows failed to support it (and we never bothered to try replacing our existing mutex locks with R/W locks anywhere within Hercules either as a result).

Now that the minimum supported platform for SoftDevLabs Hyperion has been changed to Windows Vista or greater however, concerned effort should be undertaken to provide native Windows R/W locking support via Windows's "Slim Reader/Writer (SRW) Locks" functions.

Bottom line:   Hercules's HTHREADS implementation needs a lot of attention!

@Fish-Git Fish-Git added the Enhancement This issue does not describe a problem but rather describes a suggested change or improvement. label Dec 5, 2017
@Fish-Git Fish-Git added the Related This issue is closely related to another issue. Consider this issue a "sub-issue" of the other. label Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This issue does not describe a problem but rather describes a suggested change or improvement. Related This issue is closely related to another issue. Consider this issue a "sub-issue" of the other.
Projects
None yet
Development

No branches or pull requests

1 participant