Skip to content

Commit

Permalink
revert kw thread prio modify in v1.3.18 (#168)
Browse files Browse the repository at this point in the history
* revert kw thread prio modify

Signed-off-by: Buqian Zheng <[email protected]>

* disable centos7 check for 1.x

Signed-off-by: Buqian Zheng <[email protected]>

---------

Signed-off-by: Buqian Zheng <[email protected]>
  • Loading branch information
zhengbuqian committed Nov 1, 2023
1 parent 555c56d commit 26abda0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ut.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-11, centos7 ]
os: [ macos-11 ]
env:
INSTALL_OPENBLAS: true
LD_LIBRARY_PATH: "${LD_LIBRARY_PATH}:/usr/lib"
Expand Down
17 changes: 1 addition & 16 deletions thirdparty/ctpl/ctpl-std.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include <exception>
#include <future>
#include <mutex>
#include <pthread.h>
#include <cstring>
#include <iostream>
#include <queue>


Expand Down Expand Up @@ -234,19 +231,7 @@ namespace ctpl {
return; // if the queue is empty and this->isDone == true or *flag then return
}
};
auto* t = new std::thread(f);
sched_param sch_params;
int policy = SCHED_FIFO;
sch_params.sched_priority = sched_get_priority_min(policy);
auto handle = t->native_handle();
int en = pthread_setschedparam(handle, policy, &sch_params);
if (en) {
std::cerr << "Failed to set Thread scheduling: " << std::strerror(en) << std::endl;
} else {
std::cout << "set kw thread pool thread priority to min: " << sch_params.sched_priority
<< ", max is " << sched_get_priority_max(policy) << " thread " << handle << "\n";
}
this->threads[i].reset(t); // compiler may not support std::make_unique()
this->threads[i].reset(new std::thread(f)); // compiler may not support std::make_unique()
}

void init() { this->nWaiting = 0; this->isStop = false; this->isDone = false; }
Expand Down

0 comments on commit 26abda0

Please sign in to comment.