MCPcopy Create free account
hub / github.com/apache/brpc / push_thread_which_addresses_execq

Function push_thread_which_addresses_execq

test/bthread_execution_queue_unittest.cpp:188–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void* push_thread_which_addresses_execq(void *arg) {
189 PushArg* pa = (PushArg*)arg;
190 int64_t sum = 0;
191 butil::Timer timer;
192 timer.start();
193 int num = 0;
194 bthread::ExecutionQueue<LongIntTask>::scoped_ptr_t ptr
195 = bthread::execution_queue_address(pa->id);
196 EXPECT_TRUE(ptr);
197 while (ptr->execute(num) == 0) {
198 sum += num;
199 ++num;
200 }
201 EXPECT_TRUE(ptr->stopped());
202 timer.stop();
203 pa->expected_value.fetch_add(sum, butil::memory_order_relaxed);
204 pa->total_num.fetch_add(num);
205 pa->total_time.fetch_add(timer.n_elapsed());
206 return NULL;
207}
208
209void test_performance(bool use_pthread) {
210 pthread_t threads[8];

Callers

nothing calls this directly

Calls 7

execution_queue_addressFunction · 0.85
executeMethod · 0.80
fetch_addMethod · 0.80
n_elapsedMethod · 0.80
startMethod · 0.45
stoppedMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected