Giter VIP home page Giter VIP logo

cp-tests's People

Contributors

filipedeluna avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cp-tests's Issues

6 15-16

\item Deadlock - No progress

If only two threads deadlock or livelock, shouldn't a third, doing a completely different computation, be able to progress?

If all threads do a simultaneous compare&swap, it will fail for all, I think. That's why you need to add backoffs.

Also, what is busy-waiting?

Thanks again for taking the time to help everyone out.

Missing atomic

\begin{tabular}{c | l}

This solution does not have into account "y=3" is atomic.

So it needs to be completely remade.

T1 T2 T3 T1 T2 T3 T1 T2 T3 T1 T2 T3
read x=0 read x=0 read x=0 read x=0
read y=0 read y=0 write y=3 write y=3
write y=1 write y=1 read y=3 read y=3
write y=3 write y=3 write y=4 write y=4
read y=3 write x=1 read y=4 read y=4
write x=4 read y=3 write x=5 write x=1
write x=1 write x=4 write x=1 write x=2
T1 T2 T3 T1 T2 T3 T1 T2 T3 T1 T2 T3
read y=0 write y=3
write y=1 read y=3
write y=3 write y=4
read y=3 read y=4
write x=4 write x=5
read x=4 read x=5
write x=5 write x=6

X = 1,2,4,5,6
Y = 3,4
(X,Y) = (1,3), (1,4), (2,4), (4,3), (6,4), (5,3)

Deadlock

The way it is written the program cannot deadlock, unless the client can have accounts that are references to other accounts.

Acho que pode dar um deadlock quando fazes:
transferTo(acc[2], acc[1]);
acc[0].credit(interest(0.01);

No transferTo, vais tentar ter o lock da acc[1] que já tá bloqueada, e no interest vais tentar ter o lock acc[2] que já está bloqueado.

Teria de ser a ordem:
interest lock acc[1] -> transfer2 lock acc[2] -> Deadlock?

cumps

Question 11

\item \textbf{D} - RAW, WAR and WAW affect the correctness of the program given the program is only correct if the dependency relationship is uphold.

It's B. RAR's do not.

Question 27

\item \textbf{A} - When a new process enters a system, it must declare the maximum number of instances of each resource type that it may ever claim;

Shouldn't it be C?

From the slides:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.