Changes between Version 13 and Version 14 of Projects/GSoC/PosixKeys


Ignore:
Timestamp:
Oct 8, 2012, 5:35:51 AM (9 years ago)
Author:
Zhongwei Yao
Comment:

/* the CONFIGURE of POSIX Key */

Legend:

Unmodified
Added
Removed
Modified
  • Projects/GSoC/PosixKeys

    v13 v14  
    7272
    7373there are 2 configuration options for POSIX Key:
    74         - CONFIGURE_MAXIMUM_POSIX_KEYS
    75         - CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS
     74 - CONFIGURE_MAXIMUM_POSIX_KEYS
     75 - CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS
    7676CONFIGURE_MAXIMUM_POSIX_KEYS defines the keys numbers in system. CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS defines the key-thread (or key-task in classic API) pair numbers in system. It's used for more accurate memory control. If CONFIGURE_MAXIMUM_POSIX_KEYS is defined and CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS is not defined, then each thread (and task) would have a key value instance. For example, suppose there are 5 threads in system, and there are 3 threads need key, say they are thread1, thread2, thread3 respectively. Thread1 needs 2 keys, thread2 also needs 2 keys and thread3 only needs 1 key. Then we can define CONFIGURE_MAXIMUM_POSIX_KEYS 2 and define CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS 5. If we doesn't define CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS in above example, then each thread can have its own key data, this is the same as that define CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS 10. So if we are sure about the number of thread would use key in system, we can define CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS to save memory. And CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS <= CONFIGURE_MAXIMUM_POSIX_KEYS is an error.