LRU的实现,实际上就是在算法题的基础上,加上线程完全。
用C++来写的话,可以使用哈希表和list,不用自己去实现双向链表
线程安全直接用C++11锁来做
缓冲buffer未完待续。
During the semester, you will be building a new disk-oriented storage manager for the BusTub DBMS. Such a storage manager assumes that the primary storage location of the database is on disk.
The first programming project is to implement a buffer pool in your storage manager. The buffer pool is responsible for moving physical pages back and forth from main memory to disk. It allows a DBMS to support databases that are larger than the amount of memory that is available to the system. The buffer pool's operations are transparent to other parts in the system. For example, the system asks the buffer pool for a page using its unique identifier (page_id_t
) and it does not know whether that page is already in memory or whether the system has to go retrieve it from disk.
Your implementation will need to be thread-safe. Multiple threads will be accessing the internal data structures at the same and thus you need to make sure that their critical sections are protected with latches (these are called "locks" in operating systems).
You will need to implement the following two components in your storage manager:
This is a single-person project that will be completed individually (i.e. no groups).
- Release Date: Sep 14, 2020
- Due Date: Sep 27, 2020 @ 11:59pm
For each of the following components, we are providing you with stub classes that contain the API that you need to implement. You should not modify the signatures for the pre-defined functions in these classes. If you modify the signatures, the test code that we use for grading will break and you will get no credit for the project. You also should not add additional classes in the source code for these components. These components should be entirely self-contained.
PROJECT SPECIFICATION
For each of the following components, we are providing you with stub classes that contain the API that you n