From: Mike N. <ta...@us...> - 2001-10-17 05:02:43
|
Update of /cvsroot/firebird/interbase/remote In directory usw-pr-cvs1:/tmp/cvs-serv28195 Modified Files: srvr_w32.c Log Message: Win32 CPU affinity Index: srvr_w32.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/srvr_w32.c,v retrieving revision 1.2 retrieving revision 1.3 diff -U3 -r1.2 -r1.3 --- srvr_w32.c 2000/08/05 01:03:43 1.2 +++ srvr_w32.c 2001/10/17 05:02:41 1.3 @@ -102,6 +102,8 @@ #include "../jrd/thd_proto.h" #include "../jrd/jrd_proto.h" #include "../jrd/isc_i_proto.h" +#include "../jrd/isc.h" +#include "../jrd/file_params.h" static void THREAD_ROUTINE process_connection_thread (PORT); static void THREAD_ROUTINE inet_connect_wait_thread (void *); @@ -122,6 +124,17 @@ NULL, NULL }; + +/* CPU affinity setting - default is first CPU only */ +static SLONG g_CPU_affinity_mask = ISCCFG_CPU_AFFINITY_DEF; + +static struct ipccfg CPU_affinity_setting[] = +{ + { ISCCFG_CPU_AFFINITY_TAG, 0, &g_CPU_affinity_mask, 0, 0 }, + { NULL, 0, NULL, 0, 0 } +}; + + #ifdef XNET /* put into ensure that we have a parent port for the XNET connections */ static int xnet_server_set = FALSE; @@ -149,6 +162,10 @@ int nReturnValue = 0; hInst = hThisInst; + +/* Mike Nordell - 11 Jun 2001: CPU affinity. */ +ISC_get_config (LOCK_HEADER, CPU_affinity_setting); +SetProcessAffinityMask (GetCurrentProcess (), (DWORD) g_CPU_affinity_mask); if (ISC_get_ostype()) /* True - NT, False - Win95 */ server_flag = (SRVR_multi_client); |