Skip to content

Commit 8e292a4

Browse files
committed
2 * max_running
1 parent d1a33ec commit 8e292a4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

trunk/core/judged/judged.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void init_mysql_conf() {
197197
#ifdef _mysql_h
198198
sprintf(query,
199199
"SELECT solution_id FROM solution WHERE language in (%s) and result<2 and MOD(solution_id,%d)=%d ORDER BY result ASC,solution_id ASC limit %d",
200-
oj_lang_set, oj_tot, oj_mod, 4 *max_running );
200+
oj_lang_set, oj_tot, oj_mod, 2 *max_running );
201201
#endif
202202
sleep_tmp = sleep_time;
203203
// fclose(fp);
@@ -474,6 +474,7 @@ int work() {
474474
continue;
475475
if (workcnt >= max_running) { // if no more client can running
476476
tmp_pid = waitpid(-1, NULL, WNOHANG); // wait 4 one child exit
477+
if (DEBUG) printf("try get one tmp_pid=%d\n",tmp_pid);
477478
for (i = 0; i < max_running; i++){ // get the client id
478479
if (ID[i] == tmp_pid){
479480
workcnt--;

0 commit comments

Comments
 (0)