#include #include #include std::mutex mtx1, mtx2; int shared_resource_1 = 0; int shared_resource_2 = 0; void thread1() { for (int i = 0; i
Blog
Consider a banking application where a transaction transfers…
Consider a banking application where a transaction transfers $100 from Account A to Account B. The transaction follows these steps: Debit $100 from Account A. Credit $100 to Account B. Commit the transaction. Assume that after 1 (Debit $100 from Account A) and before 2 (Credit $100 to Account B), the system crashes. Which ACID property ensures the changes persist on disk even after a system crash?
A 2Q buffer replacement policy is managing a 3-frame buffer…
A 2Q buffer replacement policy is managing a 3-frame buffer pool. The current state of the queues is: LRU Queue (ordered least recently used first → most recently used last): {1} FIFO Queue (ordered oldest inserted first → newest inserted last): {2} The next page reference is 2. What will be the new state of the queues after this access?
A 2Q buffer replacement policy is managing a 3-frame buffer…
A 2Q buffer replacement policy is managing a 3-frame buffer pool. The current state of the queues is: LRU Queue (ordered least recently used first → most recently used last): {1, 2} FIFO Queue (ordered oldest inserted first → newest inserted last): {} The next page reference is 3. What will be the new state of the queues after this access?
SELECT PostID, UserID, Content, PostDate FROM Posts; Can…
SELECT PostID, UserID, Content, PostDate FROM Posts; Can the output table of this query change across multiple executions?
You are designing a data warehouse application that aggregat…
You are designing a data warehouse application that aggregates financial data by product, time-period, and city. Data is uploaded once per day at midnight. What type of workload does this represent?
What is the correct order of evaluation for relational opera…
What is the correct order of evaluation for relational operators in SQL?
Can using a separate mutex for each page in a buffer pool av…
Can using a separate mutex for each page in a buffer pool avoid deadlocks?
In a slotted page structure, what happens when an update inc…
In a slotted page structure, what happens when an update increases the size of a tuple beyond its original allocated space (assume that the updated tuple is still smaller than the slotted page)?
2Q buffer replacement policy is managing a 3-frame buffer po…
2Q buffer replacement policy is managing a 3-frame buffer pool. The current state of the queues is: LRU Queue (ordered least recently used first → most recently used last): {1, 2} FIFO Queue (ordered oldest inserted first → newest inserted last): {9} The next page reference is 2. What will be the new state of the queues after this access?