Skip to content

Commit

Permalink
REVIEW: Code Review
Browse files Browse the repository at this point in the history
  • Loading branch information
Lior Paz committed May 27, 2021
1 parent 8aef87a commit e075530
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/ucc_progress_queue_mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
typedef struct ucc_pq_mt {
ucc_progress_queue_t super;
ucc_lf_queue_t lf_queue;
} ucc_pq_mt_t; // TODO the struct isn't a queue because not maintaining order, maybe another name
} ucc_pq_mt_t;

typedef struct ucc_pq_mt_locked {
ucc_progress_queue_t super;
Expand Down
3 changes: 1 addition & 2 deletions src/utils/ucc_lock_free_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "utils/ucc_atomic.h"
#include "utils/ucc_list.h"
#include <string.h>
#include <stdio.h>

/* This data structure is thread safe */

Expand All @@ -28,7 +27,7 @@ typedef struct ucc_lf_queue {
ucc_lf_queue_elem_t *elements[NUM_POOLS][LINE_SIZE];
uint8_t which_pool;
ucc_list_link_t locked_queue[NUM_POOLS];
} ucc_lf_queue_t; // TODO the struct isn't a queue because not maintaining order, maybe another name
} ucc_lf_queue_t;

static inline void ucc_lf_queue_enqueue(ucc_lf_queue_t * queue,
ucc_lf_queue_elem_t *elem)
Expand Down
9 changes: 5 additions & 4 deletions test/gtest/utils/test_lock_free_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ extern "C" {
#include <common/test.h>
#include <vector>

#define NUM_ITERS 5000000

typedef struct ucc_test_queue {
ucc_lf_queue_t lf_queue;
int64_t test_sum;
ucc_lf_queue_t lf_queue;
int64_t test_sum;
uint32_t elems_num;
uint32_t active_producers_threads;
uint32_t memory_err;
Expand All @@ -25,8 +27,7 @@ typedef struct ucc_test_queue {
void *producer_thread(void *arg)
{
ucc_test_queue_t *test = (ucc_test_queue_t *)arg;
for(int j = 0; j < 5000000; j++){
// TODO: should we use ucc_mc_alloc instead of ucc_malloc?
for(int j = 0; j < NUM_ITERS; j++){
ucc_lf_queue_elem_t * elem = (ucc_lf_queue_elem_t *) ucc_malloc(sizeof(ucc_lf_queue_elem_t));
elem->was_progressed = 0;
if (!elem) {
Expand Down

0 comments on commit e075530

Please sign in to comment.