| kccachedb.h | | kccachedb.h | |
| | | | |
| skipping to change at line 585 | | skipping to change at line 585 | |
| * be performed in this function. | | * be performed in this function. | |
| */ | | */ | |
| bool scan_parallel(Visitor *visitor, size_t thnum, ProgressChecker* check
er = NULL) { | | bool scan_parallel(Visitor *visitor, size_t thnum, ProgressChecker* check
er = NULL) { | |
| _assert_(visitor && thnum <= MEMMAXSIZ); | | _assert_(visitor && thnum <= MEMMAXSIZ); | |
| ScopedRWLock lock(&mlock_, false); | | ScopedRWLock lock(&mlock_, false); | |
| if (omode_ == 0) { | | if (omode_ == 0) { | |
| set_error(_KCCODELINE_, Error::INVALID, "not opened"); | | set_error(_KCCODELINE_, Error::INVALID, "not opened"); | |
| return false; | | return false; | |
| } | | } | |
| if (thnum < 1) thnum = 1; | | if (thnum < 1) thnum = 1; | |
|
| thnum = std::pow(2, (int32_t)std::log2(thnum * std::sqrt(2))); | | thnum = std::pow(2.0, (int32_t)(std::log(thnum * std::sqrt(2.0)) / std:
:log(2.0))); | |
| if (thnum > (size_t)SLOTNUM) thnum = SLOTNUM; | | if (thnum > (size_t)SLOTNUM) thnum = SLOTNUM; | |
| ScopedVisitor svis(visitor); | | ScopedVisitor svis(visitor); | |
| int64_t allcnt = count_impl(); | | int64_t allcnt = count_impl(); | |
| if (checker && !checker->check("scan_parallel", "beginning", -1, allcnt
)) { | | if (checker && !checker->check("scan_parallel", "beginning", -1, allcnt
)) { | |
| set_error(_KCCODELINE_, Error::LOGIC, "checker failed"); | | set_error(_KCCODELINE_, Error::LOGIC, "checker failed"); | |
| return false; | | return false; | |
| } | | } | |
| class ThreadImpl : public Thread { | | class ThreadImpl : public Thread { | |
| public: | | public: | |
| explicit ThreadImpl() : | | explicit ThreadImpl() : | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|