The metalock Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The metalock Reference Manual

This is the metalock Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Wed Nov 04 14:30:22 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

metalock

This is a project simply provides a metaclass which when used means that you do not have to manually manage locks. This package exports one thing metalock which is a metaclass for use with whatever class definitions you want. This metaclass is implemented using *-using-class methods so your distribution of CL must use these methods to implement access functions like 'slot-value' for this metaclass to work. Obviously it must also implement the MOP. I have tested on SBCL 1.4.9 only.

Access to slots is controlled using read-writer locks described here: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_a_condition_variable_and_a_mutex

(defclass myclass ()
  ((oneslot :accessor oneslot :initform 1))
 (:metaclass metalock:metalock))

Instantiate and use like normal.

License

MIT


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 metalock

Author

K1D77A

License

MIT

Description

A metaclass that makes building parallel systems easier by providing each slot within a class a lock which is grabbed automatically.

Version

0.0.1

Dependencies
Source

metalock.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 metalock.asd

Location

metalock.asd

Systems

metalock (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 metalock/package.lisp

Parent

metalock (system)

Location

package.lisp

Packages

metalock


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 metalock/readwriter-lock.lisp

Dependency

package.lisp (file)

Parent

metalock (system)

Location

readwriter-lock.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 metalock/metalock.lisp

Dependency

readwriter-lock.lisp (file)

Parent

metalock (system)

Location

metalock.lisp

Exported Definitions

metalock (class)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 metalock

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions

metalock (class)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Classes

Class: metalock ()
Package

metalock

Source

metalock.lisp (file)

Direct superclasses

standard-class (class)

Direct methods
  • compute-slots (method)
  • slot-makunbound-using-class (method)
  • slot-boundp-using-class (method)
  • slot-value-using-class (method)
  • slot-value-using-class (method)
  • validate-superclass (method)

Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: read-with-rw-lock (READER-WRITER-LOCK) &body BODY
Package

metalock

Source

readwriter-lock.lisp (file)

Macro: while-loop TEST &body BODY
Package

metalock

Source

readwriter-lock.lisp (file)

Macro: write-with-rw-lock (READER-WRITER-LOCK) &body BODY
Package

metalock

Source

readwriter-lock.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: make-special-slot KEYS
Package

metalock

Source

metalock.lisp (file)

Function: slot-names-to-lock-alist SLOT-NAMES
Package

metalock

Source

metalock.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: active-writer-p OBJECT
Generic Function: (setf active-writer-p) NEW-VALUE OBJECT
Package

metalock

Methods
Method: active-writer-p (READER-WRITER-LOCK reader-writer-lock)

automatically generated reader method

Source

readwriter-lock.lisp (file)

Method: (setf active-writer-p) NEW-VALUE (READER-WRITER-LOCK reader-writer-lock)

automatically generated writer method

Source

readwriter-lock.lisp (file)

Generic Function: condition-var OBJECT
Generic Function: (setf condition-var) NEW-VALUE OBJECT
Package

metalock

Methods
Method: condition-var (READER-WRITER-LOCK reader-writer-lock)

automatically generated reader method

Source

readwriter-lock.lisp (file)

Method: (setf condition-var) NEW-VALUE (READER-WRITER-LOCK reader-writer-lock)

automatically generated writer method

Source

readwriter-lock.lisp (file)

Generic Function: g-lock OBJECT
Generic Function: (setf g-lock) NEW-VALUE OBJECT
Package

metalock

Methods
Method: g-lock (READER-WRITER-LOCK reader-writer-lock)

automatically generated reader method

Source

readwriter-lock.lisp (file)

Method: (setf g-lock) NEW-VALUE (READER-WRITER-LOCK reader-writer-lock)

automatically generated writer method

Source

readwriter-lock.lisp (file)

Generic Function: readers-active OBJECT
Generic Function: (setf readers-active) NEW-VALUE OBJECT
Package

metalock

Methods
Method: readers-active (READER-WRITER-LOCK reader-writer-lock)

automatically generated reader method

Source

readwriter-lock.lisp (file)

Method: (setf readers-active) NEW-VALUE (READER-WRITER-LOCK reader-writer-lock)

automatically generated writer method

Source

readwriter-lock.lisp (file)

Generic Function: writers-waiting OBJECT
Generic Function: (setf writers-waiting) NEW-VALUE OBJECT
Package

metalock

Methods
Method: writers-waiting (READER-WRITER-LOCK reader-writer-lock)

automatically generated reader method

Source

readwriter-lock.lisp (file)

Method: (setf writers-waiting) NEW-VALUE (READER-WRITER-LOCK reader-writer-lock)

automatically generated writer method

Source

readwriter-lock.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Classes

Class: reader-writer-lock ()
Package

metalock

Source

readwriter-lock.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: condition-var
Initform

(bordeaux-threads:make-condition-variable)

Readers

condition-var (generic function)

Writers

(setf condition-var) (generic function)

Slot: g-lock
Type

bordeaux-threads:lock

Initform

(bordeaux-threads:make-lock)

Readers

g-lock (generic function)

Writers

(setf g-lock) (generic function)

Slot: readers-active
Type

integer

Initform

0

Readers

readers-active (generic function)

Writers

(setf readers-active) (generic function)

Slot: writers-waiting
Type

integer

Initform

0

Readers

writers-waiting (generic function)

Writers

(setf writers-waiting) (generic function)

Slot: active-writer-p
Type

boolean

Readers

active-writer-p (generic function)

Writers

(setf active-writer-p) (generic function)

Class: special-slot ()
Package

metalock

Source

metalock.lisp (file)

Direct superclasses

standard-effective-slot-definition (class)

Direct methods
  • compute-effective-slot-definition (method)
  • validate-superclass (method)

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

F
File, Lisp, metalock.asd: The metalock․asd file
File, Lisp, metalock/metalock.lisp: The metalock/metalock․lisp file
File, Lisp, metalock/package.lisp: The metalock/package․lisp file
File, Lisp, metalock/readwriter-lock.lisp: The metalock/readwriter-lock․lisp file

L
Lisp File, metalock.asd: The metalock․asd file
Lisp File, metalock/metalock.lisp: The metalock/metalock․lisp file
Lisp File, metalock/package.lisp: The metalock/package․lisp file
Lisp File, metalock/readwriter-lock.lisp: The metalock/readwriter-lock․lisp file

M
metalock.asd: The metalock․asd file
metalock/metalock.lisp: The metalock/metalock․lisp file
metalock/package.lisp: The metalock/package․lisp file
metalock/readwriter-lock.lisp: The metalock/readwriter-lock․lisp file

Jump to:   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   F   G   M   R   S   W  
Index Entry  Section

(
(setf active-writer-p): Internal generic functions
(setf active-writer-p): Internal generic functions
(setf condition-var): Internal generic functions
(setf condition-var): Internal generic functions
(setf g-lock): Internal generic functions
(setf g-lock): Internal generic functions
(setf readers-active): Internal generic functions
(setf readers-active): Internal generic functions
(setf writers-waiting): Internal generic functions
(setf writers-waiting): Internal generic functions

A
active-writer-p: Internal generic functions
active-writer-p: Internal generic functions

C
condition-var: Internal generic functions
condition-var: Internal generic functions

F
Function, make-special-slot: Internal functions
Function, slot-names-to-lock-alist: Internal functions

G
g-lock: Internal generic functions
g-lock: Internal generic functions
Generic Function, (setf active-writer-p): Internal generic functions
Generic Function, (setf condition-var): Internal generic functions
Generic Function, (setf g-lock): Internal generic functions
Generic Function, (setf readers-active): Internal generic functions
Generic Function, (setf writers-waiting): Internal generic functions
Generic Function, active-writer-p: Internal generic functions
Generic Function, condition-var: Internal generic functions
Generic Function, g-lock: Internal generic functions
Generic Function, readers-active: Internal generic functions
Generic Function, writers-waiting: Internal generic functions

M
Macro, read-with-rw-lock: Internal macros
Macro, while-loop: Internal macros
Macro, write-with-rw-lock: Internal macros
make-special-slot: Internal functions
Method, (setf active-writer-p): Internal generic functions
Method, (setf condition-var): Internal generic functions
Method, (setf g-lock): Internal generic functions
Method, (setf readers-active): Internal generic functions
Method, (setf writers-waiting): Internal generic functions
Method, active-writer-p: Internal generic functions
Method, condition-var: Internal generic functions
Method, g-lock: Internal generic functions
Method, readers-active: Internal generic functions
Method, writers-waiting: Internal generic functions

R
read-with-rw-lock: Internal macros
readers-active: Internal generic functions
readers-active: Internal generic functions

S
slot-names-to-lock-alist: Internal functions

W
while-loop: Internal macros
write-with-rw-lock: Internal macros
writers-waiting: Internal generic functions
writers-waiting: Internal generic functions

Jump to:   (  
A   C   F   G   M   R   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   A   C   G   R   S   W  
Index Entry  Section

A
active-writer-p: Internal classes

C
condition-var: Internal classes

G
g-lock: Internal classes

R
readers-active: Internal classes

S
Slot, active-writer-p: Internal classes
Slot, condition-var: Internal classes
Slot, g-lock: Internal classes
Slot, readers-active: Internal classes
Slot, writers-waiting: Internal classes

W
writers-waiting: Internal classes

Jump to:   A   C   G   R   S   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   M   P   R   S  
Index Entry  Section

C
Class, metalock: Exported classes
Class, reader-writer-lock: Internal classes
Class, special-slot: Internal classes

M
metalock: The metalock system
metalock: The metalock package
metalock: Exported classes

P
Package, metalock: The metalock package

R
reader-writer-lock: Internal classes

S
special-slot: Internal classes
System, metalock: The metalock system

Jump to:   C   M   P   R   S