summaryrefslogtreecommitdiffstats
path: root/private/nw/rdr/synch.txt
diff options
context:
space:
mode:
Diffstat (limited to 'private/nw/rdr/synch.txt')
-rw-r--r--private/nw/rdr/synch.txt74
1 files changed, 74 insertions, 0 deletions
diff --git a/private/nw/rdr/synch.txt b/private/nw/rdr/synch.txt
new file mode 100644
index 000000000..82d68ee1a
--- /dev/null
+++ b/private/nw/rdr/synch.txt
@@ -0,0 +1,74 @@
+This file describes use of resources and spin locks with the netware
+redirector. There are 2 major sections - global locks, and per structure
+locks. Each subsection names a lock or resources and list all of the
+global variable, and structure fields it protects.
+
+
+1. Global Locks
+
+1.1 ScbSpinLock
+ - ScbQueue
+ - NpScb fields -> ScbLinks
+ - Nearest server table.
+
+1.2 Rcb->Resource
+ - ServerNameTable
+ - FileNameTable, Fcb->PrefixEntry
+ - Rcb fields -> OpenCount
+ - Synchronize access to newly created FCBs
+ - DefaultUserName, DefaultPassword, DefaultServerName.
+ - Fcb->IcbList, Icb->ListEntry
+ - DriveMapTable
+ - Vcb->ReferenceCount, Vcb->FcbList, Vcb->FcbCount, GlobalVcbListEntry
+ - Scb->ScbSpecificVcbQueue, Scb->VcbCount, OpenFileCount, AttachCount
+ - GlobalVcbList, CurrentVcbEntry
+
+1.3 NwScavengerSpinLock
+ - NwScavengerTickCount
+
+1.4 Front of the SCB queue
+ - Icb->State, HasRemoteHandle
+ - NpScb->State
+ - pScb->UserName, pScb->Password
+ - Fcb->FileSize (except during create)
+
+1.5 NwMessageSpinLock
+ - NwGetMessageList
+
+1.6 NwPendingLockSpinLock
+ - NwPendingLockList
+
+1.7 NwFcbTableResource
+ - FCB / ICB creation.
+
+2. Per structure locks
+
+2.1 SCB->NpScbSpinLock
+ - NpScb fields -> Sending, Receiving, OkToReceive, TimeOut,
+ MaxTimeOut, Requests, RetryCount, Reference
+
+2.2 FCB->Resource
+ - Fcb-> Attributes, LastModifiedDate, LastModifiedTime
+ State, FileLockList, PendingLockList,
+
+2.3 Front of the SCB queue
+ - Icb->FileLockList
+
+2.4 LOGON->CredListResource
+ Protects the credentials on the cred list
+ and the list pointers. Acquire shared for
+ read access to the list. Acquire exclusive
+ for write access to the list.
+
+In order to eliminate dead locks, locks should be acquired in the following
+order (if multiple locks are needed).
+
+RCB->Resource
+FCB->Resource
+NwScavengerSpinLock
+LOGON->CredListResource
+ScbSpinLock
+SCB->NpScbSpinLock
+
+A thread cannot wait for the SCB queue while holding any other lock.
+