Basic naive, single-threaded queue implementation. Slow.#1
Basic naive, single-threaded queue implementation. Slow.#1andrewmains12 merged 2 commits intokevints:cs194_masterfrom
Conversation
There was a problem hiding this comment.
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?
|
LGTM, go ahead and merge. |
There was a problem hiding this comment.
We need to think about refactoring this - a tiny malloc on every node overshadows any possible gains from parallelism
There was a problem hiding this comment.
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 notifications@github.com 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.
Basic naive, single-threaded queue implementation. Slow.
Added very basic queue logic. It's not parallel, nor threadsafe. It's abysmally slow, but it works.