DOC PREVIEW
USC CSCI 585 - VHints

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

V Storage ManagerTracesQuestionsSlide 4HintsSlide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12V Storage ManagerV Storage ManagerShahram GhandeharizadehShahram GhandeharizadehComputer Science DepartmentComputer Science DepartmentUniversity of Southern CaliforniaUniversity of Southern CaliforniaTracesTracesMake sure your persistent BDB is configured Make sure your persistent BDB is configured with 256 MB of memory.with 256 MB of memory.With a trace, say 21, use its “21Objs.Save” to With a trace, say 21, use its “21Objs.Save” to create and populate your persistent create and populate your persistent database. Subsequently, use its database. Subsequently, use its “Trace21.1KGet” to debug your software.“Trace21.1KGet” to debug your software.Start with 1 thread and expand to 2, 3, and 4.Start with 1 thread and expand to 2, 3, and 4.Try to make your software as efficient as Try to make your software as efficient as possible. If it is too slow (maybe because of possible. If it is too slow (maybe because of low byte hit rates) then you may not be able low byte hit rates) then you may not be able to run “Trace21.1MGet”.to run “Trace21.1MGet”.QuestionsQuestionsQuestionsQuestionsWill there be another release of the workload Will there be another release of the workload generator before Friday?generator before Friday?I do not anticipate one unless there is a bug I do not anticipate one unless there is a bug report.report.Is there an obvious item missing from the Is there an obvious item missing from the current workload generator?current workload generator?Mandatory: Invocation of the method to report Mandatory: Invocation of the method to report cache and byte hit rates.cache and byte hit rates.Optional: Dump the content of the cache to Optional: Dump the content of the cache to analyze the behavior of your cache replacement analyze the behavior of your cache replacement technique.technique.HintsHintsBDB-Disk is a full-fledged storage manager BDB-Disk is a full-fledged storage manager with a buffer pool, locking, crash-recovery, with a buffer pool, locking, crash-recovery, index structures.index structures.Configure its buffer pool size to be 256 MB.Configure its buffer pool size to be 256 MB.V FunctionalitiesV FunctionalitiesCache ReplacementCache ReplacementBDB-DiskBDB-DiskBDB-MemBDB-MemHintsHintsYour implementation may need to keep track Your implementation may need to keep track of different counters. Example: count the of different counters. Example: count the number of requests issued (and the number number of requests issued (and the number of requests serviced from the main-memory of requests serviced from the main-memory instance of BDB) to compute the cache hit instance of BDB) to compute the cache hit rate.rate.How to do this with multiple worker threads? How to do this with multiple worker threads?HintsHintsYour implementation may need to keep track Your implementation may need to keep track of different counters. Example: count the of different counters. Example: count the number of requests issued to compute the number of requests issued to compute the cache hit rate.cache hit rate.How to do this with multiple worker threads?How to do this with multiple worker threads?The interlocked function provides a mechanism The interlocked function provides a mechanism for synchronizing access to a variable that is for synchronizing access to a variable that is shared by multiple threads. shared by multiple threads. You may define a “long” variable and use You may define a “long” variable and use InterlockedIncrement: “long cntr; InterlockedIncrement: “long cntr; InterlockedIncrement(&cntr);”InterlockedIncrement(&cntr);”Make sure to include <windows.h> Make sure to include <windows.h>HintsHintsTo compute byte hit rates, you need to To compute byte hit rates, you need to maintain two counters and increment them maintain two counters and increment them by the size of the referenced object. by the size of the referenced object. Use “InterlockedExchangeAdd” function to Use “InterlockedExchangeAdd” function to perform an atomic addition of two 32 bit perform an atomic addition of two 32 bit values. values. Example: a = a + b;Example: a = a + b;InterlockedExchangeAdd(&a, &b);InterlockedExchangeAdd(&a, &b);Other Interlocked methods might be useful to Other Interlocked methods might be useful to you, such as InterlockedExchangePointer.you, such as InterlockedExchangePointer.HintsHintsWith invocation of methods, local variables With invocation of methods, local variables are pushed on the stack of a thread.are pushed on the stack of a thread.4 different threads invoking a method will have 4 4 different threads invoking a method will have 4 different sets of mutually exclusive local different sets of mutually exclusive local variables as declared by that method.variables as declared by that method.Foo(){Foo(){Char res[200];Char res[200];Int cntr;Int cntr;……}}A global variable is not part of the stack and A global variable is not part of the stack and must be protected when multiple threads are must be protected when multiple threads are manipulating it. How?manipulating it. How?HintsHintsWith invocation of methods, local variables With invocation of methods, local variables are pushed on the stack of a thread.are pushed on the stack of a thread.4 different threads invoking a method will have 4 4 different threads invoking a method will have 4 different sets of mutually exclusive local different sets of mutually exclusive local variables as declared by that method.variables as declared by that method.Foo(){Foo(){Char res[200];Char res[200];Int cntr;Int cntr;……}}A global variable is not part of the stack and must A global variable is not part of the stack and must be protected when multiple threads are be protected when multiple threads are manipulating it. How?manipulating it. How?Consider making it a variable local to a method. Ask: Consider making it a variable local to a method. Ask: Does this variable have to be global?Does this variable have to be global?Use critical sections.Use critical sections.Manage memory.Manage memory.HintsHintsWith invocation of methods, local variables With invocation of methods, local variables are pushed on the stack of a thread.are pushed on the stack of a thread.4 different


View Full Document

USC CSCI 585 - VHints

Download VHints
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view VHints and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view VHints 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?