Changeset 1789 for pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c
- Timestamp:
- Feb 13, 2008 3:17:28 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c
r1405 r1789 222 222 * period of time. 223 223 */ 224 static int perform_test(int sock_type, const char *type_name, 224 static int perform_test(pj_bool_t allow_concur, 225 int sock_type, const char *type_name, 225 226 unsigned thread_cnt, unsigned sockpair_cnt, 226 227 pj_size_t buffer_size, … … 261 262 } 262 263 264 rc = pj_ioqueue_set_default_concurrency(ioqueue, allow_concur); 265 if (rc != PJ_SUCCESS) { 266 app_perror("...error: pj_ioqueue_set_default_concurrency()", rc); 267 return -16; 268 } 269 263 270 /* Initialize each producer-consumer pair. */ 264 271 for (i=0; i<sockpair_cnt; ++i) { … … 438 445 } 439 446 440 /* 441 * main test entry. 442 */ 443 int ioqueue_perf_test(void) 447 static int ioqueue_perf_test_imp(pj_bool_t allow_concur) 444 448 { 445 449 enum { BUF_SIZE = 512 }; … … 501 505 502 506 PJ_LOG(3,(THIS_FILE, " Benchmarking %s ioqueue:", pj_ioqueue_name())); 507 PJ_LOG(3,(THIS_FILE, " Testing with concurency=%d", allow_concur)); 503 508 PJ_LOG(3,(THIS_FILE, " =======================================")); 504 509 PJ_LOG(3,(THIS_FILE, " Type Threads Skt.Pairs Bandwidth")); … … 509 514 pj_size_t bandwidth; 510 515 511 rc = perform_test(test_param[i].type, 516 rc = perform_test(allow_concur, 517 test_param[i].type, 512 518 test_param[i].type_name, 513 519 test_param[i].thread_cnt, … … 538 544 } 539 545 546 /* 547 * main test entry. 548 */ 549 int ioqueue_perf_test(void) 550 { 551 int rc; 552 553 rc = ioqueue_perf_test_imp(PJ_TRUE); 554 if (rc != 0) 555 return rc; 556 557 rc = ioqueue_perf_test_imp(PJ_FALSE); 558 if (rc != 0) 559 return rc; 560 561 return 0; 562 } 563 540 564 #else 541 565 /* To prevent warning about "translation unit is empty"
Note: See TracChangeset
for help on using the changeset viewer.