summaryrefslogtreecommitdiff
path: root/fml/doc/en/tutorial/internals/lock.sgml
blob: 3b6be85a446bcc0a788253ef3e9635db1dc00d63 (plain)
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
75
76
77
78
79
80
81
82
83
<!--
   $FML: lock.sgml,v 1.1 2005/07/27 12:21:36 fukachan Exp $
-->


<chapter id="lock">
	<title>
	Lock
	</title>

<para>
Synchronization among processes uses lock.
&fml8; provides flock(2) or lockf(2) based lock mechanism.
</para>


<sect1 id="lock.overview">
	<title>
	Overview: Lock
	</title>

<para>
After 2003/03, &fml8; provides more granular not giant lock. 
</para>

<para>
Each resource defines each lock channel name.
</para>

<para>
For example,
Mail::Delivery related class accesses the member list.
It needs several locks. 
</para>

<para>
Mail::Delivery::SMTP needs lock of member list.
FML::Send and FML::Process::Delivery locks member list access 
in callling Mail::Delivery::SMTP.
</para>

<para>
Instead 
Mail::Delivery::Queue just sees the mail queue.
The function can access the queue concurrently, also.
So this module does not need lock.
</para>

<para>
Generally speaking, modules using maps require lock.
For example, 
FML/Command/UserControl.pm  and
FML/Command/Auth.pm
needs write lock, but
FML/Credential.pm
needs only read lock.
</para>

<para>
It is useful if &fml8; provides reader writer lock. But it is not implemented.
Currently we attension we use short critical region. 
</para>

</sect1>


<sect1 id="lock.todo">
	<title>
	TODO
	</title>

<para>
Mutex lock in calling *_maps.
</para>

<para>
READER WRITER LOCK in calling IO::Adapter.
</para>

</sect1>


</chapter>