[ntp:hackers] Ntpd Processor Affinity

Ajit Aranha ajit_aranha at rocketmail.com
Tue Sep 12 06:08:17 UTC 2006


Hi Martin,
 Ntpd works fine on Windows with processor affinity set only for the
interpolation thread.(Tested on a dual processor system)

Am listing the changes below.If required i can send you the changed
files:

nt_clockstuff.c:

in init_winnt_time():
//SetThreadAffinityMask(GetCurrentThread(), 1L); <--commented

/*---- Gerhard Junker */
StartClockThread();


DWORD WINAPI ClockThread(void *arg)
{
	LARGE_INTEGER DueTime;
	HANDLE WaitableTimerHandle = CreateWaitableTimer(NULL, FALSE, NULL);

	(void) arg; /* not used */

	SetThreadAffinityMask(GetCurrentThread(), 1L); //<---------- added


win32_io.c

int NT_set_process_priority(void)
{
//<----- removed Processor affinity stuff
	if (!SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)) 
		{
		msyslog(LOG_ERR, "SetPriorityClass: %m"); 
		return 0;
		}
	else 
		return 1;
}

Regards,
Ajit

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the hackers mailing list