Skip to content
Snippets Groups Projects
Commit 08341b20 authored by Peter J. Keleher's avatar Peter J. Keleher
Browse files

auto

parent 8ec7279f
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ The database system is written in Python and attempts to simulate how a database
#### Synchronization in Python
Although you won't need to do any synchronization-related coding, it would be necessary for you to understand the basic Python synchronization primitives. The manual
explain this quite well: [https://docs.python.org/2/library/threading.html](High-level Threading Interface in Python). Some basics:
explains this quite well: [https://docs.python.org/3/library/threading.html](High-level Threading Interface in Python). Some basics:
- Each transaction for us will be started in a sepearate thread (see `testingLock.py` for some examples). The main command for doing so is: `threading.Thread`, which takes a function name as an argument.
- The main synchronization primitives are: `Lock` and `RLock` (Sections 16.2.2 and 16.2.3 in the manual above). You create them by calling `threading.Lock()` or `threading.RLock()`, and you use them by acquiring and releasing them. Only one thread can take a Lock or a RLock at any time.
- Two other primitives build on top of the above: `Conditions` and `Events`. See the manual for the details on those. We use `Conditions` in `transactions.py` to signal threads.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment