Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/mty-makai/mty.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 199 by notanpe, Thu Jun 26 12:56:55 2008 UTC revision 200 by notanpe, Fri Jun 27 14:38:47 2008 UTC
# Line 1025  typedef HANDLE THREAD_EV_T; Line 1025  typedef HANDLE THREAD_EV_T;
1025  #define thread_clear_event(ev) ResetEvent(ev)  #define thread_clear_event(ev) ResetEvent(ev)
1026  #define thread_get_tid()        GetCurrentThread()  #define thread_get_tid()        GetCurrentThread()
1027  #define thread_set_priority(tid,n)      SetThreadPriority(tid, n)  #define thread_set_priority(tid,n)      SetThreadPriority(tid, n)
1028    #if 0
1029    #undef thread_set_priority /* MAKAI */
1030    #endif
1031  #define thread_set_affinity(tid,m)      SetThreadAffinityMask(tid, (DWORD_PTR)1 << (m))  #define thread_set_affinity(tid,m)      SetThreadAffinityMask(tid, (DWORD_PTR)1 << (m))
1032    
1033  static  static
# Line 1498  main(int argc, char *argv[]) Line 1501  main(int argc, char *argv[])
1501          break;          break;
1502        }        }
1503       }       }
1504         if ( pmask < MIN_THREAD ) {
1505          usage( argv[0] );
1506          exit( 1 );
1507         }
1508       break;       break;
1509      case 'h':      case 'h':
1510       usage( argv[0] );       usage( argv[0] );
# Line 1549  main(int argc, char *argv[]) Line 1556  main(int argc, char *argv[])
1556      proc_mask = thread_avail();      proc_mask = thread_avail();
1557     } else {     } else {
1558      proc_mask = pmask;      proc_mask = pmask;
1559      printf( "%d 個の検索スレッドを生成\n", popcnt64( proc_mask ) );      printf( "CPU : " );
1560        for ( i = 0; i < MAX_THREAD; i++ ) {
1561         if ( pmask & 1 ) {
1562          printf( "%d ", i );
1563         }
1564         pmask >>= 1;
1565        }
1566        printf( "を使用します。\n" );
1567    #ifdef WIN32
1568        SetProcessAffinityMask( GetCurrentProcess(), proc_mask );
1569    #endif /* WIN32 */
1570     }     }
1571    } else {    } else {
1572     int  i;     int  i;
# Line 1562  main(int argc, char *argv[]) Line 1579  main(int argc, char *argv[])
1579    }    }
1580  /* MAKAI end */  /* MAKAI end */
1581    
1582    if (proc_mask == 1U)    if (popcnt64(proc_mask) == 1) /* MAKAI */
1583          {          {
1584            /* single */            /* single */
1585            npkts = 1;            npkts = 1;

Legend:
Removed from v.199  
changed lines
  Added in v.200

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26