VirtualBox

Changeset 1303 in kBuild for trunk/src/kmk


Ignore:
Timestamp:
Dec 1, 2007 11:17:46 PM (17 years ago)
Author:
bird
Message:

Added an --affinity option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/main.c

    r1280 r1303  
    312312    4 = realtime / nice -19; */
    313313int process_priority = 0;
    314 #endif
     314
     315/* Process affinity mask; 0 means any CPU. */
     316int process_affinity = 0;
     317#endif /* KMK */
    315318
    316319
     
    431434#endif
    432435#ifdef KMK
    433     { CHAR_MAX+5, positive_int, (char *) &process_priority, 1, 1, 0,
     436    { CHAR_MAX+6, positive_int, (char *) &process_priority, 1, 1, 0,
    434437      (char *) &process_priority, (char *) &process_priority, "priority" },
     438    { CHAR_MAX+7, positive_int, (char *) &process_affinity, 1, 1, 0,
     439      (char *) &process_affinity, (char *) &process_affinity, "affinity" },
    435440#endif
    436441    { 'q', flag, &question_flag, 1, 1, 1, 0, 0, "question" },
     
    711716#ifdef KMK
    712717static void
    713 set_make_priority (void)
     718set_make_priority_and_affinity (void)
    714719{
    715720#ifdef WINDOWS32
     
    726731    }
    727732  SetPriorityClass(GetCurrentProcess(), dwPriority);
     733  if (process_affinity)
     734    SetThreadAffinityMask(GetCurrentProcess(), process_affinity);
     735
    728736#else /*#elif HAVE_NICE */
    729737  int nice_level = 0;
     
    740748  nice (nice_level);
    741749#endif
     750  /** @todo bitch about failures. */
    742751}
    743752#endif
     
    14911500
    14921501#ifdef KMK
    1493   set_make_priority ();
     1502  set_make_priority_and_affinity ();
    14941503#endif
    14951504
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette