Skip to content

Commit

Permalink
customer: fallback to fifo (#11)
Browse files Browse the repository at this point in the history
* customer: refactor and reduce cpu load

* initial change

* improve performance

* improve hash and terminate

* cleaning

* fine-grained mutex

* improvement

* fall back to map_mu_

* customer: fallback to fifo

* clean customer.h

* not functional change

* non-functional change
  • Loading branch information
ymjiang authored Nov 19, 2019
1 parent 2f448be commit 7672fdc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 430 deletions.
23 changes: 0 additions & 23 deletions include/ps/internal/customer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@
#include "ps/internal/message.h"
#include "ps/internal/threadsafe_queue.h"
namespace ps {

/**
* \brief The structure for profiling
*/
struct Profile {
uint64_t key;
int sender;
bool is_push;
std::string ts;
bool is_begin;
};

/**
* \brief The object for communication.
*
Expand Down Expand Up @@ -100,14 +88,6 @@ class Customer {
recv_queue_.Push(recved);
}

void ProcessPullRequest(int worker_id);
void ProcessPushRequest(int thread_id);
void ProcessProfileData();
bool IsValidPushpull(const Message& msg);
uint64_t GetKeyFromMsg(const Message& msg);
void ProcessResponse(int thread_id);
std::string GetTimestampNow();

private:
/**
* \brief the thread function
Expand All @@ -126,9 +106,6 @@ class Customer {
std::condition_variable tracker_cond_;
std::vector<std::pair<int, int>> tracker_;

// for storing profile data
ThreadsafeQueue<Profile> pdata_queue_;

DISALLOW_COPY_AND_ASSIGN(Customer);
};

Expand Down
Loading

0 comments on commit 7672fdc

Please sign in to comment.