Changes between Version 10 and Version 11 of Projects/GSoC/PosixKeys


Ignore:
Timestamp:
Oct 5, 2012, 5:14:53 PM (7 years ago)
Author:
Zhongwei Yao
Comment:

add the configure of POSIX key

Legend:

Unmodified
Added
Removed
Modified
  • Projects/GSoC/PosixKeys

    v10 v11  
    6969   space of one-rbtree per-thread:
    7070   S2 = m * 20 + m * t * 24 + t * 24
    71 and '''S1 - S2  = 12 * t * ( m - 1)'''. The one-rbtree approach needs more memory. However, both approaches need '''O(m * t)''' memory.
     71and '''S1 - S2  = 12 * t * ( m - 1)'''. The one-rbtree approach needs more memory. However, both approaches need '''O(m * t)''' memory.=  the CONFIGURE of POSIX Key  =
     72
     73there are 2 configuration options for POSIX Key:
     74        - CONFIGURE_MAXIMUM_POSIX_KEYS
     75        - CONFIGURE_MAXIMUM_POSIX_KEY_PAIRS
     76CONFIGURE_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
     77       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.