Skip to content

Conversation

@maxdjohnson
Copy link
Collaborator

Added very basic queue logic. It's not parallel, nor threadsafe. It's abysmally slow, but it works.

Copy link
Owner

Choose a reason for hiding this comment

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

Lots of extra copies of objspace, potentially refactor later to use a st_table <objspace*, mark_queue_node_t*> and remove that pointer from mark_queue_node_t to save space?

@kevints
Copy link
Owner

kevints commented Nov 7, 2012

LGTM, go ahead and merge.

Copy link
Owner

Choose a reason for hiding this comment

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

We need to think about refactoring this - a tiny malloc on every node overshadows any possible gains from parallelism

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree--I think the best approach is probably to use a circular buffer to implement
fixed size queues (similar to what the current implementation does for the mark stack.)

On Nov 8, 2012, at 12:25 PM, Kevin Sweeney [email protected] wrote:

In gc.c:

@@ -1650,6 +1670,45 @@ struct mark_tbl_arg {
}

void
+gc_mark_defer(rb_objspace_t *objspace, VALUE ptr, int lev) {

  • mark_queue_node_t* node =
  • (mark_queue_node_t*) malloc(sizeof(mark_queue_node_t));
    We need to think about refactoring this - a tiny malloc on every node overshadows any possible gains from parallelism


Reply to this email directly or view it on GitHub.

andrewmains12 pushed a commit that referenced this pull request Nov 12, 2012
Basic naive, single-threaded queue implementation. Slow.
@andrewmains12 andrewmains12 merged commit 036d641 into kevints:cs194_master Nov 12, 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.

3 participants