diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-08-04 16:07:50 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-08-04 16:07:50 -0400 |
commit | f9aa663ad7fbe2ef25cf9c0efe871e6404e7986a (patch) | |
tree | 0b87f0712ff9aa668d962d7cdbd1911ac733683d | |
parent | 46d98270e29210f8cacb79ca66a4d53680338c89 (diff) |
Allow preemptive-spinning configuration.
-rw-r--r-- | include/config.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h index c5e38a2..af41d42 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -12,6 +12,10 @@ | |||
12 | */ | 12 | */ |
13 | #ifndef _USE_LITMUS | 13 | #ifndef _USE_LITMUS |
14 | #define PGM_SYNC_METHOD 0 | 14 | #define PGM_SYNC_METHOD 0 |
15 | /* You must define PGM_ALLOW_P_SPIN if | ||
16 | preemptions remain enabled. | ||
17 | */ | ||
18 | /* #define PGM_SYNC_METHOD 1 */ | ||
15 | #else | 19 | #else |
16 | /* Default to PGM spinlocks under Litmus */ | 20 | /* Default to PGM spinlocks under Litmus */ |
17 | #define PGM_SYNC_METHOD 1 | 21 | #define PGM_SYNC_METHOD 1 |
@@ -32,6 +36,8 @@ | |||
32 | */ | 36 | */ |
33 | #ifndef _USE_LITMUS | 37 | #ifndef _USE_LITMUS |
34 | #define PGM_NP_METHOD 0 | 38 | #define PGM_NP_METHOD 0 |
39 | /* Uncomment to allow preemptive spinning sync */ | ||
40 | /* #define PGM_ALLOW_P_SPIN */ | ||
35 | #else | 41 | #else |
36 | /* Default to Litmus NP sections. */ | 42 | /* Default to Litmus NP sections. */ |
37 | #define PGM_NP_METHOD 2 | 43 | #define PGM_NP_METHOD 2 |
@@ -54,7 +60,7 @@ | |||
54 | #error "Cannot disable interrupts using pthread synchronization." | 60 | #error "Cannot disable interrupts using pthread synchronization." |
55 | #endif | 61 | #endif |
56 | 62 | ||
57 | #if (PGM_SYNC_METHOD == 1) && (PGM_NP_METHOD == 0) | 63 | #if (PGM_SYNC_METHOD == 1) && (PGM_NP_METHOD == 0) && !defined(PGM_ALLOW_P_SPIN) |
58 | #error "Spinlocks are unsafe without non-preemption." | 64 | #error "Spinlocks are unsafe without non-preemption." |
59 | #endif | 65 | #endif |
60 | 66 | ||