Dijkstra Critical Thinking Summary

Improved Essays
Question 1
1.1)
a)
The dining philosophers is a theory thought up by E.W Dijkstra. He said that five philosophers sit at a circular dinner table with five chairs and five forks. Each philosopher wants to eat so they pick up 2 forks and after a while place them back on the table when they’re done.
Deadlock will be caused if every philosopher tries to pick up the fork to their left, as it will result in circular waiting. If the chain of waiting can be broken, deadlock will be prevented. If a philosopher picks up his left chopstick first he is known as a left and vice versa.
Preventing deadlock can be done through picking a single philosopher and making him a righty while the rest are all lefties. This can be done with numerous as long
…show more content…
Process 2 requires 100ms and is entered 50ms after the first.
Process 2 will be completed first assuming each process receives 100ms of processing time per round.
Batch processing is the execution of multiple programs without the need for human interaction or intervention. Once the job has been setup it can be completed fully without the need for any additional information required from the user. Any inputs required from the user will be entered before the processing is done. An interface or script will be used to collect all the required data. Once everything is collected it will process it and return a final output.
This form of processing can have a few benefits such as being able to process information when the cpu isn’t occupied with other tasks. It doesn’t make the cpu wait mid process if more user interaction is required. Overhead is reduced due to a program only being run once for initial data collection instead of each time a new transaction is entered.
Spring batch is a batch processing framework that is designed to optimise large scale batch applications used in enterprise solutions. It includes logging, statistics, resource management and allows the user to restart or skip certain
…show more content…
Only one writer may access the critical area at any time. If there is no writer busy in the critical area any number of readers can access it. In this case we use a mutex to allow concurrent threads access to shared data.
The shown solution uses a semaphore with a counter initialised to set how many readers can access the critical section at once. The writer reduces the semaphore number by the number of readers and waits for all readers to complete their process. While waiting it prevents other readers from starting. The problem with this solution is that it requires the writer to know how many readers there are and it contains a linear loop dependant on the number of readers.
This causes the writer to starve while it is waiting for all the readers to finish their job. A common solution to the problem would be to add a semaphore that waits before the write, checks if readers are 1 then signals with the previous semaphore. On the writer side it waits and signals the same as the 1st semaphore would.
Here is an

Related Documents

  • Improved Essays

    Nt1330 Unit 5 Essay

    • 596 Words
    • 3 Pages

    5.10 A user level program can disable the timer interrupt and prevent context switching from taking place if it is given the ability to disable interrupts. This also allows it to use the processor without letting other processes execute. 5.11 It depends on how interrupts are implemented, but regardless, it is not a good choice of techniques.…

    • 596 Words
    • 3 Pages
    Improved Essays
  • Improved Essays

    Pt1420 Unit 5 Lab 1

    • 382 Words
    • 2 Pages

    cs61002: Algorithms and Programing 1 rbattul1 Lab Assignment 5: Summary of chapters 2.1 to 2.6 of python scientific notes. Summary:…

    • 382 Words
    • 2 Pages
    Improved Essays
  • Decent Essays

    Hsc300 Unit 4 Study Guide

    • 390 Words
    • 2 Pages

    Process2 Process3 Process4 Process5 T=0 15 17 23 25 35 Shortest Job First: Here in this process our priority is time remaining for the completion of project, i.e. Burst Time. (non-preemptive) Process1 Process2…

    • 390 Words
    • 2 Pages
    Decent Essays
  • Decent Essays

    Nt1310 Unit 6

    • 910 Words
    • 4 Pages

    The following diagrams show how the user would act and interact with the system and the various activities that user would perform: 2.3.1 NOTATIONS DATA FLOW…

    • 910 Words
    • 4 Pages
    Decent Essays
  • Improved Essays

    The problem or the issue addressed is on how to parallelize the computation, distribute the data, and handle failures conspire to obscure the original simple computation with large amounts of complex code to deal with these issues. Contributions are simple powerful interface that gives parallelization and distribution of large scale systems. So to tackle the issue of parallelization, fault tolerance and distribution of data, they acquired the map and reduce primitives. The use of a functional model with user-specified map and reduce operations allows us to parallelize large computations easily and to use re-execution as the primary mechanism for fault tolerance.…

    • 868 Words
    • 4 Pages
    Improved Essays
  • Improved Essays

    Liquid Compounding Process

    • 1173 Words
    • 5 Pages

    1.0 PURPOSE: To implement a process that will ensure that non-conforming batches will go through the correct process and procedure for correction/adjustment and that all documentation and subsequent batch releases are issued to the work order for filling. This procedure will also eliminate accretion of previous blends in the liquid compounding area. 2.0 SCOPE: This procedure applies to the Liquid Compounding, Pre-weigh area and Lab. 3.0 RESPONSIBILITY: It is the responsibility of the Compounding Manager, Compounding Lead and Compounding associate, Scheduling Clerk, Pre-weigh Manager, Pre-weigh associates, Lab Manager and Lab Technicians to follow this procedure.…

    • 1173 Words
    • 5 Pages
    Improved Essays
  • Decent Essays

    Robert leads with introducing himself and lets the client know that he has good news, prior to asking if it's a good time to talk. (00:29) Robert lets the client know that he touched base with SunTrust and that the lien release is on it's way and that is all we need. (1:21) Robert breaks down the loan cost to the client, foreshadows what he can do regarding the interest rate and the cost of the loan.…

    • 185 Words
    • 1 Pages
    Decent Essays
  • Improved Essays

    The poem depicts an explicit view on the purpose of literature today, as we generation Z and future generations are straying away from the meanings of literature to a more scientific understanding. The scientific community and the Language arts community are at a conflict together as one community seeks only the answers while the other takes the individual, and guides them on a journey that will bring them to the depths of critical thinking. This is implied in the poem when the author suggests dropping a mouse into the poem searching and feeling the walls for the light switch. The mouse represents us, a timid creature with tunnel vision, focused exclusively for an escape rather than observe our environment. The searching and feeling…

    • 286 Words
    • 2 Pages
    Improved Essays
  • Improved Essays

    1. For some doing wrong is a sense of pleasure, rather than doing the right thing. Some people find life better to do others wrong rather than being a victim of someone who has done them wrong. Glucson makes things clear when he states that “those who practice justice do so involuntarily and because they have not the power to be unjust will best appear if we imagine something of this kind”. In other words, to my understanding he is making it clear that those who practice justice have come to an agreement for those who do things justice vs others who do wrong-doings.…

    • 464 Words
    • 2 Pages
    Improved Essays
  • Improved Essays

    For instance there may be a tenet that the philosophers put down a fork in the wake of sitting tight ten minutes for the other fork to end up accessible and hold up a further ten minutes before making their next endeavor. This plan dispenses with the likelihood of deadlock (the system can simply progress to an alternate state) yet at the same time experiences the problem of live lock. On the off chance that every one of the five philosophers show up in the dining room at the very same time and every gets the left fork in the meantime the philosophers will hold up ten minutes until they all put their forks down and afterward hold up a further ten minutes before they all lift them up once…

    • 689 Words
    • 3 Pages
    Improved Essays
  • Superior Essays

    In addition, they are also experiencing class struggles. America is a country, which is made up of immigrants. If there weren’t a great number of people from all over the world move to the US, there wouldn’t be a multicultural and diversified America now. Nevertheless, the differences among cultures cause plenty of conflicts like racism. Those characters in the movie “crash” each other not only because of racism, but also because of the different social class they are in.…

    • 1230 Words
    • 5 Pages
    • 3 Works Cited
    Superior Essays
  • Improved Essays

    Disagreement is to tennis as dissent is to boxing. Disagreement is an idea, whereas dissent is a personal value or belief. Typically, disagreements are less intense than dissension because they are less personal. Disagreements also tend to be amongst equals, both parties share the power, passing ideas back and forth.…

    • 517 Words
    • 3 Pages
    Improved Essays
  • Improved Essays

    From activity and sequence diagram overall flow of the program is generated. Each diagram will produce the code depend on abstraction level of diagram. The overall code from behavior diagrams will be placed in structural code generated from class…

    • 789 Words
    • 4 Pages
    Improved Essays
  • Improved Essays

    Divide and Conquer Strategies: Divide and conquer is an algorithm which design paradigm based on multi-branched recursion. This designed paradigm consists of following phases: 1) Break the problem (divide): Breaking the problem into several sub-problems that are smaller in size. 2) Solve the sub problem(conquer) : Solve the sub-problem recursively .…

    • 718 Words
    • 3 Pages
    Improved Essays
  • Great Essays

    Nt1330 Unit 1 Study Guide

    • 1161 Words
    • 5 Pages

    Question no: 1 Explain and differentiate between software, hardware and firmware: Software: Software is a set of programs that are executed in hardware. Moreover, software is a set of hardware instructions and their representations, which we call programs. The American heritage dictionary defines software as: “Written or printed data such as programs, routines and symbolic languages, essential to the operation of computers.”…

    • 1161 Words
    • 5 Pages
    Great Essays