Previous 199869 Revisions Next

r34238 Wednesday 7th January, 2015 at 15:47:09 UTC by Oliver Stöneberg
osd_work: use n threads when n CPUs are detected since modern CPUs have at least two cores per CPU (nw)

also makes -np use the actual number supplied across all platforms
[src/osd/modules/sync]work_osd.c

trunk/src/osd/modules/sync/work_osd.c
r242749r242750
208208   // on a single-CPU system, create 1 thread for I/O queues, and 0 threads for everything else
209209   if (numprocs == 1)
210210      threadnum = (flags & WORK_QUEUE_FLAG_IO) ? 1 : 0;
211   // TODO: chose either
212#if defined(OSD_WINDOWS)
213211   // on an n-CPU system, create n threads for multi queues, and 1 thread for everything else
214212   else
215213      threadnum = (flags & WORK_QUEUE_FLAG_MULTI) ? numprocs : 1;
216#else
217   // on an n-CPU system, create (n-1) threads for multi queues, and 1 thread for everything else
218   else
219      threadnum = (flags & WORK_QUEUE_FLAG_MULTI) ? (numprocs - 1) : 1;
220#endif
221214
222215   if (osdworkqueuemaxthreads != NULL && sscanf(osdworkqueuemaxthreads, "%d", &osdthreadnum) == 1 && threadnum > osdthreadnum)
223216      threadnum = osdthreadnum;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team