c - Is there a cross platform version of window vista's slim reader writer locks? -
I'm completely blowing away from the quality of the Windows SRW implementation, its fast then important class and its only byte memory overhead Are there.
Unfortunately this is only Windows Vista / Windows 7
Since it is a pure user land implementation, does anyone know that there is a cross-platform implementation for it? Anyone there reverse-engineered solution?
And please do not want me to add stuff like boost just pull in a less then 100 log solution.
After the
you want some "portable" in the sense of conforming to some standard ... you are using POSIX's formula is
and friends. These are not normally but rather unix-type OSes.
Was on Windows but but what do you mean if "portable" means "portable for many versions of Windows ..." are making some non-documentary calls in Ntdll which implements RW lock
RtlAcquireResourceShared ()
and RtlAcquireResourceExclusive ()
Here are some prototypes:.
zero WINAPI RtlInitializeResource (LPRTL_RWLOCK RWL); Zero WINAPI RtlDeleteResource (LPRTL_RWLOCK rwl); BYTE WINAPI RtlAcquireResourceExclusive (LPRTL_RWLOCK rwl, BYTE fWait); BYTE WINAPI RtlAcquireResourceShared (LPRTL_RWLOCK rwl, BYTE fWait); Zero WINAPI RtlReleaseResource (LPRTL_RWLOCK rwl);
Note that you may have to
from ntdll.dll
to yourself.
There is a question of referencing structure. Here's the WINE speech:
typedef struct _RTL_RWLOCK {RTL_CRITICAL_SECTION rtlCS; Handling relative authoring; UINT UyrsWitter; Handle Haccilichrellis Memphor; UINT UXCliquiliter; INT iNumberActive; Handling Honestthread ID; DWORD dwTimeoutBoost; PVOID pDebugInfo; } RTL_RWLOCK, * LPRTL_RWLOCK;
If you do not want to use pthreads and you want to link sketchy without unused functionality ... you can see a rwlock implementation in the context of others and apply it manually Can operate ... say
, or perhaps high-level priorities like borderline and incidents.
Comments
Post a Comment