- wrapper: set thread priority of worker processes

to IDLE class (Win);
		set prior of worker processes to PROCESS_IDLE_PRIORITY (Unix)

	uppercase/
		upper_case.C
	wrapper/
		wrapper.C

svn path=/trunk/boinc_samples/; revision=12927
This commit is contained in:
David Anderson 2007-06-13 16:42:36 +00:00
parent dc1d875365
commit dde65419d1
3 changed files with 11 additions and 8 deletions

View File

@ -374,3 +374,12 @@ David 8 June 2007
uc2.C,h
uc2_graphics.C
David 13 June 2007
- wrapper: set thread priority of worker processes
to IDLE class (Win);
set prior of worker processes to PROCESS_IDLE_PRIORITY (Unix)
uppercase/
upper_case.C
wrapper/
wrapper.C

View File

@ -229,14 +229,6 @@ int main(int argc, char **argv) {
int i;
int retval = 0;
boinc_init_diagnostics(
BOINC_DIAG_DUMPCALLSTACKENABLED |
BOINC_DIAG_HEAPCHECKENABLED |
BOINC_DIAG_MEMORYLEAKCHECKENABLED |
BOINC_DIAG_TRACETOSTDERR |
BOINC_DIAG_REDIRECTSTDERR
);
for (i=0; i<argc; i++) {
if (!strcmp(argv[i], "-early_exit")) early_exit = true;
if (!strcmp(argv[i], "-early_crash")) early_crash = true;

View File

@ -250,6 +250,7 @@ int TASK::run(int argct, char** argvt) {
}
pid_handle = process_info.hProcess;
thread_handle = process_info.hThread;
SetThreadPriority(thread_handle, THREAD_PRIORITY_IDLE);
#else
int retval, argc;
char progname[256], buf[256];
@ -294,6 +295,7 @@ int TASK::run(int argct, char** argvt) {
strlcpy(arglist, command_line.c_str(), sizeof(arglist));
argc = parse_command_line(arglist, argv+1);
fprintf(stderr, "wrapper: running %s (%s)\n", buf, arglist);
setpriority(PRIO_PROCESS, 0, PROCESS_IDLE_PRIORITY);
retval = execv(buf, argv);
exit(ERR_EXEC);
}