Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: Synchronization (30 pts] Consider a shared database with two classes of users: Readers - never modify database. Writers read and modify database. As

image text in transcribed

image text in transcribed

Question 1: Synchronization (30 pts] Consider a shared database with two classes of users: Readers - never modify database. Writers read and modify database. As discussed in lecture, concurrency functionality can be implemented with the following scheme Scheme A: Shared Data: Semaphore rw_mutex initialized to 1 Semaphore mutex initialized to 1 Integer read_count initialized to o Writer Process: do wait (rw_mutex); i* writing is performed / signal(rw_mutex); } while (true); Reader Process: do wait (mutex); read_count++; if (read_count == 1) wait (rw_mutex); signal (mutex); 7 reading is performed / wait (mutex); read_count--; if (read_count == 0) signal (rw_mutex); signal (mutex); } while (true); Now consider a new class of user called Scrubbers. Scrubbers perform an action which is to scrub items in the database. We can have an arbitrary number of scrubbers scrubbing the same item at once. An item should not be read or written while it is being scrubbed. An item should not scrubbed while it is being written or read. Write down a scheme in a format like scheme A above which implements the concurrency functionality of Readers, Writers, and Scrubbers. [30 pts] Question 1: Synchronization (30 pts] Consider a shared database with two classes of users: Readers - never modify database. Writers read and modify database. As discussed in lecture, concurrency functionality can be implemented with the following scheme Scheme A: Shared Data: Semaphore rw_mutex initialized to 1 Semaphore mutex initialized to 1 Integer read_count initialized to o Writer Process: do wait (rw_mutex); i* writing is performed / signal(rw_mutex); } while (true); Reader Process: do wait (mutex); read_count++; if (read_count == 1) wait (rw_mutex); signal (mutex); 7 reading is performed / wait (mutex); read_count--; if (read_count == 0) signal (rw_mutex); signal (mutex); } while (true); Now consider a new class of user called Scrubbers. Scrubbers perform an action which is to scrub items in the database. We can have an arbitrary number of scrubbers scrubbing the same item at once. An item should not be read or written while it is being scrubbed. An item should not scrubbed while it is being written or read. Write down a scheme in a format like scheme A above which implements the concurrency functionality of Readers, Writers, and Scrubbers. [30 pts]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

What is Working Capital ? Explain its types.

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago