1 / 12

V Storage Manager

V Storage Manager. Shahram Ghandeharizadeh Computer Science Department University of Southern California. Traces. Make sure your persistent BDB is configured with 256 MB of memory.

maya-perry
Télécharger la présentation

V Storage Manager

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. V Storage Manager Shahram Ghandeharizadeh Computer Science Department University of Southern California

  2. Traces • Make sure your persistent BDB is configured with 256 MB of memory. • With a trace, say 21, use its “21Objs.Save” to create and populate your persistent database. Subsequently, use its “Trace21.1KGet” to debug your software. • Start with 1 thread and expand to 2, 3, and 4. • Try to make your software as efficient as possible. If it is too slow (maybe because of low byte hit rates) then you may not be able to run “Trace21.1MGet”.

  3. Questions

  4. Questions • Will there be another release of the workload generator before Friday? • I do not anticipate one unless there is a bug report. • Is there an obvious item missing from the current workload generator? • Mandatory: Invocation of the method to report cache and byte hit rates. • Optional: Dump the content of the cache to analyze the behavior of your cache replacement technique.

  5. Hints • BDB-Disk is a full-fledged storage manager with a buffer pool, locking, crash-recovery, index structures. • Configure its buffer pool size to be 256 MB. V Functionalities Cache Replacement BDB-Disk BDB-Mem

  6. Hints • Your implementation may need to keep track of different counters. Example: count the number of requests issued (and the number of requests serviced from the main-memory instance of BDB) to compute the cache hit rate. • How to do this with multiple worker threads?

  7. Hints • Your implementation may need to keep track of different counters. Example: count the number of requests issued to compute the cache hit rate. • How to do this with multiple worker threads? • The interlocked function provides a mechanism for synchronizing access to a variable that is shared by multiple threads. • You may define a “long” variable and use InterlockedIncrement: “long cntr; InterlockedIncrement(&cntr);” • Make sure to include <windows.h>

  8. Hints • To compute byte hit rates, you need to maintain two counters and increment them by the size of the referenced object. • Use “InterlockedExchangeAdd” function to perform an atomic addition of two 32 bit values. • Example: a = a + b; • InterlockedExchangeAdd(&a, &b); • Other Interlocked methods might be useful to you, such as InterlockedExchangePointer.

  9. Hints • With invocation of methods, local variables are pushed on the stack of a thread. • 4 different threads invoking a method will have 4 different sets of mutually exclusive local variables as declared by that method. Foo(){ Char res[200]; Int cntr; … } • A global variable is not part of the stack and must be protected when multiple threads are manipulating it. How?

  10. Hints • With invocation of methods, local variables are pushed on the stack of a thread. • 4 different threads invoking a method will have 4 different sets of mutually exclusive local variables as declared by that method. Foo(){ Char res[200]; Int cntr; … } • A global variable is not part of the stack and must be protected when multiple threads are manipulating it. How? • Consider making it a variable local to a method. Ask: Does this variable have to be global? • Use critical sections. • Manage memory.

  11. Hints • With invocation of methods, local variables are pushed on the stack of a thread. • 4 different threads invoking a method will have 4 different sets of mutually exclusive local variables as declared by that method. Foo(){ Char res[200]; Int cntr; … } • Similarly, memory allocated from the heap (new/malloc) is not a part of the stack and must be managed. • No memory-leaks.

  12. Hints • Consider an admission control technique. • Without admission control: • Everytime an object is referenced and it is not in memory then you place it in memory. • With admission control: • Every time a disk resident object is referenced, compare its Q value with the minimum Q value to see if it should be admitted into memory.

More Related