summaryrefslogtreecommitdiffstats
path: root/private/nw/rdr/synch.txt
blob: 82d68ee1a408cfbb0d591cf267bcb93b6aca45d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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.