Skip to content

Commit 96439f1

Browse files
authored
更新-w auto在单核设备上的行为
1 parent 8c6505a commit 96439f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core_start.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static inline void cfadmin_specify_nprocess(const char* w) {
9595
nprocess = 1;
9696
/* 自动检查可用核心数量 */
9797
if (!strcmp(w, "auto"))
98-
nprocess = sysconf(_SC_NPROCESSORS_ONLN) < 1 ? 1 : sysconf(_SC_NPROCESSORS_ONLN);
98+
nprocess = sysconf(_SC_NPROCESSORS_ONLN) < 2 ? 2 : sysconf(_SC_NPROCESSORS_ONLN);
9999
}
100100

101101
/* 后台运行 */
@@ -290,8 +290,8 @@ int main(int argc, char const *argv[]) {
290290
cfadmin_init_args(argc, argv);
291291

292292
#if defined(__MSYS__) || defined(__CYGWIN__)
293-
/* Windows下不可使用多进程 */
294-
nprocess = 1;
293+
/* Windows下不可使用多进程 */
294+
nprocess = 1;
295295
#else
296296
int n = -1;
297297
if (getenv("cfadmin_nprocess"))

0 commit comments

Comments
 (0)