Skip to content

Added tests for deque; fixed several bugs#11

Merged
kevints merged 11 commits intokevints:devlfrom
andrewmains12:andrew_bugfix
Nov 25, 2012
Merged

Added tests for deque; fixed several bugs#11
kevints merged 11 commits intokevints:devlfrom
andrewmains12:andrew_bugfix

Conversation

@andrewmains12
Copy link
Collaborator

Explanation is mostly in the title.

The bugs in question are these:

  1. mod in C with a negative number will return a negative number, which was not what I expected. I replaced naive calls to mod in the deque code with a macro that works the way I wanted (the way that Python behaves).
  2. The code to push and pop from the global queue didn't correctly check whether it could in fact pull/push as much as it wanted to from the queue.
  3. The call to pthread_mutex_trylock wasn't checked properly--it returns 0 on success, but the conditional treated it as if it returned 1 when locking succeed.

There remain memory errors; valgrind keeps telling me things about reads in freed blocks, which probably means we're missing some objects in our mark. I'm implementing a testing framework to compare against the single threaded implementation to work on this.

kevints added a commit that referenced this pull request Nov 25, 2012
Added tests for deque; fixed several bugs
@kevints kevints merged commit 251137b into kevints:devl Nov 25, 2012
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