Question

In: Computer Science

Recall the Kung and Robinson optimistic concurrency control algorithm. How can you modify that algorithm to...

Recall the Kung and Robinson optimistic concurrency control algorithm. How can you modify that algorithm to ensure that every transaction eventually completes?

Solutions

Expert Solution

Optimistic iconcurrency icontrol i(OCC) iis ia iconcurrency icontrol imethod iapplied ito itransactional isystems isuch ias irelational idatabase imanagement isystems(dbms) iand isoftware itransactional imemory. iOCC iassumes ithat imultiple itransactions ican ifrequently icomplete iwithout iinterfering ieach iother. iWhile irunning, itransactions iuse ithe idata iresources iwithout iacquiring ilocks ion ithose iresources. iBefore icommitting, ieach itransaction iverifies ithat ino iother itransaction ihas imodified ithat idata iit ihas iread. iIf ithe icheck ireveals iconflicting imodifications, ithe icommitting itransaction irolls iback iand ican ibe irestarted.

Optimistic iconcurrency icontrol itransactions iinvolve ibelow iphases:

  • Begin: iRecord ia itimestamp imarking ithe itransaction's ibeginning.
  • Modify: iRead idatabase ivalues, iand itentatively iwrite ichanges.
  • Validate: iCheck iwhether iother itransactions ihave imodified idata ithat ithis itransaction ihas iused i(read ior iwritten). iThis iincludes itransactions ithat icompleted iafter ithe itransaction's istart itime, iand ioptionally, itransactions ithat iare istill iactive iat iits ivalidation itime.
  • Commit/Rollback: iIf ithere iare ino iconflict, imake iall ichanges itake ieffect. iIf ithere iis ia iconflict, iresolve iit, itypically iby iaborting ithe itransaction, ialthough iother iresolution ischemes iare ipossible. iCare imust ibe itaken ito iavoid ia i(TOCTTOU) itime-of-check ito itime-of-use i ibug, iparticularly iif ithis iphase iand ithe iprevious ione iare inot iperformed ias ia isingle iatomic ioperation.

Related Solutions

Below are the control strategy of hydraulic hybrid vehicle. How can I modify code below to...
Below are the control strategy of hydraulic hybrid vehicle. How can I modify code below to include the torque of motor of hydraulic hybrid vehicle? and How can I improve this function [SOC,k,T_engine,S_engine,T_brake,T_pump] = strategy(duration,gamma,P,V,Pmin,Pmax,Vmin,Vmax,SOC,Disp,T_wheel,S_wheel,gearratio,S_map,Te_max,T_engine,S_engine,T_pm,k,eff_mech,eff_hyd) S_flywheel = S_wheel*gearratio; T_flywheel = T_wheel/gearratio; T_brake = 0; if SOC < 0.1 k=1; %Engine on elseif SOC > 0.7 k=0; %Engine off end %T_pump +ve = charging %T-pump -ve = discharging if k==1 if T_engine*eff_mech < T_flywheel    %Engine provides full torque when hydraulic...
Explain the difference between concurrency and parallelism. Using these concepts, discuss how a multi-threaded application can...
Explain the difference between concurrency and parallelism. Using these concepts, discuss how a multi-threaded application can run faster than a single-threaded application on a single-processor machine and on a multi-processor machine.
Why is it important to track cash flow by period. How can you modify net income...
Why is it important to track cash flow by period. How can you modify net income to approximate cash flow? What factors influence the timing of receipts when you have a collections policy for accounts receivable that comes in over time? How do you approximate the net cash flow for a project where the cash is commingled with the rest of the business?
In Occupational Therapy, how can you modify jenga game to meet the need for community based/transition19...
In Occupational Therapy, how can you modify jenga game to meet the need for community based/transition19 year old working on bulidimg job skills?
Can you orally modify a contract that is in writing and within the Statute of Frauds?
Can you orally modify a contract that is in writing and within the Statute of Frauds?
which access control best describes the following scenario. your boss asked you to modify the files...
which access control best describes the following scenario. your boss asked you to modify the files and send them to him one hour. when you log into the system to find the following message. The error states that a user does not have permission to access this file contact your system administrator the error is an example of which the access control model is it a)Access Control Matrix b)Physical Acess Control c)Discretionary access control
Describe the anodizing for the nanowire fabrication. How can you control the dimensions of nanowires?
Describe the anodizing for the nanowire fabrication. How can you control the dimensions of nanowires?
Explain how a firm can modify their product line to increase customer satisfaction.
Explain how a firm can modify their product line to increase customer satisfaction.
How can I determine or explain how BingoSort is a stable sorting algorithm or not?
The following submission rules apply: • For those questions requiring programs, the solutions must be implemented using JavaScript or Java. o Appropriate self-documenting comments in the source code are mandatory, consistent with good programming practices. o Solutions must be provided in plain text so that formatting is not lost. • All answers must be provided in this document. • Sources must be given accurate and complete citations sufficient for the instructor to find and confirm them.How can I determine or...
Can you touch in ways how you brought innovative solutions as a internal control analyst? Be...
Can you touch in ways how you brought innovative solutions as a internal control analyst? Be detailed?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT