Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work Done #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Work Done #26

wants to merge 1 commit into from

Conversation

darshan4694
Copy link

@darshan4694 darshan4694 commented Oct 13, 2016

Name: Darshan Shah
SMU ID # 46916705


end

def new_counter(a) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-10

You were supposed to add the new_counter and next_value functions in the Ex01 module, but you added them to the tests.

Then, because the tests failed, you updated the tests to make it work.

You can't change the tests: they are the specification you're supposed to be implementing.

Agent.start( fn -> value end)
end

def next_value({:ok, count}) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-5 for part 1, -3 for part 2

You use get followed by update. This is a bug.

Imagine there were two processes accessing the same counter at the same time. They both get the current value, then both add one to it and store it back.

As a result, the two processes both get the same value of the counter.

@darshan4694
Copy link
Author

I lost total 18 points in this assignment, so my score must be 62/80. But on canvas I got 56/80. Please note this and I request you to update my score on canvas.

@pragdave
Copy link
Contributor

pragdave commented Nov 29, 2016 via email

@darshan4694
Copy link
Author

Thank you so much Sir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants