Changeset b0c7419 for tests/concurrent/park
- Timestamp:
- Feb 14, 2020, 3:28:17 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8c50aed
- Parents:
- 50b8885
- Location:
- tests/concurrent/park
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/park/.expect/force_preempt.txt
r50b8885 rb0c7419 1 0 Calling unpark (No Force) 0 2 1 Calling unpark (No Force) 0 3 2 Calling unpark (No Force) 0 4 3 Calling unpark (No Force) 0 5 4 Calling unpark (No Force) 0 6 0 Parking (No Force) 0 7 0 Unparked (No Force) 0 8 0 Calling unpark (No Force) 1 9 1 Parking (No Force) 0 10 1 Unparked (No Force) 0 11 1 Calling unpark (No Force) 1 12 2 Parking (No Force) 0 13 2 Unparked (No Force) 0 14 2 Calling unpark (No Force) 1 15 3 Parking (No Force) 0 16 3 Unparked (No Force) 0 17 3 Calling unpark (No Force) 1 18 4 Parking (No Force) 0 19 4 Unparked (No Force) 0 20 4 Calling unpark (No Force) 1 21 0 Parking (No Force) 1 22 0 Unparked (No Force) 1 23 0 Calling unpark (No Force) 2 24 1 Parking (No Force) 1 25 1 Unparked (No Force) 1 26 1 Calling unpark (No Force) 2 27 2 Parking (No Force) 1 28 2 Unparked (No Force) 1 29 2 Calling unpark (No Force) 2 30 3 Parking (No Force) 1 31 3 Unparked (No Force) 1 32 3 Calling unpark (No Force) 2 33 4 Parking (No Force) 1 34 4 Unparked (No Force) 1 35 4 Calling unpark (No Force) 2 36 0 Parking (No Force) 2 37 0 Unparked (No Force) 2 38 0 Calling unpark (No Force) 3 39 1 Parking (No Force) 2 40 1 Unparked (No Force) 2 41 1 Calling unpark (No Force) 3 42 2 Parking (No Force) 2 43 2 Unparked (No Force) 2 44 2 Calling unpark (No Force) 3 45 3 Parking (No Force) 2 46 3 Unparked (No Force) 2 47 3 Calling unpark (No Force) 3 48 4 Parking (No Force) 2 49 4 Unparked (No Force) 2 50 4 Calling unpark (No Force) 3 51 0 Parking (No Force) 3 52 0 Unparked (No Force) 3 53 0 Calling unpark (No Force) 4 54 1 Parking (No Force) 3 55 1 Unparked (No Force) 3 56 1 Calling unpark (No Force) 4 57 2 Parking (No Force) 3 58 2 Unparked (No Force) 3 59 2 Calling unpark (No Force) 4 60 3 Parking (No Force) 3 61 3 Unparked (No Force) 3 62 3 Calling unpark (No Force) 4 63 4 Parking (No Force) 3 64 4 Unparked (No Force) 3 65 4 Calling unpark (No Force) 4 66 0 Parking (No Force) 4 67 0 Unparked (No Force) 4 68 0 Calling unpark (Force) 0 69 1 Parking (No Force) 4 70 1 Unparked (No Force) 4 71 1 Calling unpark (Force) 0 72 2 Parking (No Force) 4 73 2 Unparked (No Force) 4 74 2 Calling unpark (Force) 0 75 3 Parking (No Force) 4 76 3 Unparked (No Force) 4 77 3 Calling unpark (Force) 0 78 4 Parking (No Force) 4 79 4 Unparked (No Force) 4 80 4 Calling unpark (Force) 0 81 0 Parking (Force) 0 82 1 Parking (Force) 0 83 2 Parking (Force) 0 84 3 Parking (Force) 0 85 4 Parking (Force) 0 86 0 Unparked (Force) 0 87 0 Calling unpark (Force) 1 88 1 Unparked (Force) 0 89 1 Calling unpark (Force) 1 90 2 Unparked (Force) 0 91 2 Calling unpark (Force) 1 92 3 Unparked (Force) 0 93 3 Calling unpark (Force) 1 94 4 Unparked (Force) 0 95 4 Calling unpark (Force) 1 96 0 Parking (Force) 1 97 1 Parking (Force) 1 98 2 Parking (Force) 1 99 3 Parking (Force) 1 100 4 Parking (Force) 1 101 0 Unparked (Force) 1 102 0 Calling unpark (Force) 2 103 1 Unparked (Force) 1 104 1 Calling unpark (Force) 2 105 2 Unparked (Force) 1 106 2 Calling unpark (Force) 2 107 3 Unparked (Force) 1 108 3 Calling unpark (Force) 2 109 4 Unparked (Force) 1 110 4 Calling unpark (Force) 2 111 0 Parking (Force) 2 112 1 Parking (Force) 2 113 2 Parking (Force) 2 114 3 Parking (Force) 2 115 4 Parking (Force) 2 116 0 Unparked (Force) 2 117 0 Calling unpark (Force) 3 118 1 Unparked (Force) 2 119 1 Calling unpark (Force) 3 120 2 Unparked (Force) 2 121 2 Calling unpark (Force) 3 122 3 Unparked (Force) 2 123 3 Calling unpark (Force) 3 124 4 Unparked (Force) 2 125 4 Calling unpark (Force) 3 126 0 Parking (Force) 3 127 1 Parking (Force) 3 128 2 Parking (Force) 3 129 3 Parking (Force) 3 130 4 Parking (Force) 3 131 0 Unparked (Force) 3 132 0 Calling unpark (Force) 4 133 1 Unparked (Force) 3 134 1 Calling unpark (Force) 4 135 2 Unparked (Force) 3 136 2 Calling unpark (Force) 4 137 3 Unparked (Force) 3 138 3 Calling unpark (Force) 4 139 4 Unparked (Force) 3 140 4 Calling unpark (Force) 4 141 0 Parking (Force) 4 142 1 Parking (Force) 4 143 2 Parking (Force) 4 144 3 Parking (Force) 4 145 4 Parking (Force) 4 146 0 Unparked (Force) 4 147 1 Unparked (Force) 4 148 2 Unparked (Force) 4 149 3 Unparked (Force) 4 150 4 Unparked (Force) 4 1 0 Calling unpark 0 2 1 Calling unpark 0 3 2 Calling unpark 0 4 3 Calling unpark 0 5 4 Calling unpark 0 6 0 Parking 0 7 0 Unparked 0 8 0 Calling unpark 1 9 1 Parking 0 10 1 Unparked 0 11 1 Calling unpark 1 12 2 Parking 0 13 2 Unparked 0 14 2 Calling unpark 1 15 3 Parking 0 16 3 Unparked 0 17 3 Calling unpark 1 18 4 Parking 0 19 4 Unparked 0 20 4 Calling unpark 1 21 0 Parking 1 22 0 Unparked 1 23 0 Calling unpark 2 24 1 Parking 1 25 1 Unparked 1 26 1 Calling unpark 2 27 2 Parking 1 28 2 Unparked 1 29 2 Calling unpark 2 30 3 Parking 1 31 3 Unparked 1 32 3 Calling unpark 2 33 4 Parking 1 34 4 Unparked 1 35 4 Calling unpark 2 36 0 Parking 2 37 0 Unparked 2 38 0 Calling unpark 3 39 1 Parking 2 40 1 Unparked 2 41 1 Calling unpark 3 42 2 Parking 2 43 2 Unparked 2 44 2 Calling unpark 3 45 3 Parking 2 46 3 Unparked 2 47 3 Calling unpark 3 48 4 Parking 2 49 4 Unparked 2 50 4 Calling unpark 3 51 0 Parking 3 52 0 Unparked 3 53 0 Calling unpark 4 54 1 Parking 3 55 1 Unparked 3 56 1 Calling unpark 4 57 2 Parking 3 58 2 Unparked 3 59 2 Calling unpark 4 60 3 Parking 3 61 3 Unparked 3 62 3 Calling unpark 4 63 4 Parking 3 64 4 Unparked 3 65 4 Calling unpark 4 66 0 Parking 4 67 0 Unparked 4 68 1 Parking 4 69 1 Unparked 4 70 2 Parking 4 71 2 Unparked 4 72 3 Parking 4 73 3 Unparked 4 74 4 Parking 4 75 4 Unparked 4 -
tests/concurrent/park/force_preempt.cfa
r50b8885 rb0c7419 20 20 21 21 22 void park_loop(Waiter & this, int id, bool force) { 22 volatile int count = 0; 23 24 void main(Waiter & this) { 25 // Get a unique id 26 int id = __atomic_fetch_add(&count, 1, __ATOMIC_SEQ_CST); 23 27 24 28 for(int i = 0; i < 5; i++) { 25 29 // Unpark this thread, don't force a yield 26 sout | id | "Calling unpark" | (force ? "(Force)" : "(No Force)") |i;27 unpark(this , force);30 sout | id | "Calling unpark" | i; 31 unpark(this); 28 32 29 33 // Force a preemption before the call to park … … 32 36 33 37 // Park this thread, 34 sout | id | "Parking" | (force ? "(Force)" : "(No Force)")| i;38 sout | id | "Parking" | i; 35 39 park(); 36 sout | id | "Unparked" | (force ? "(Force)" : "(No Force)") |i;40 sout | id | "Unparked" | i; 37 41 } 38 }39 40 volatile int count = 0;41 42 void main(Waiter & this) {43 // Get a unique id44 int id = __atomic_fetch_add(&count, 1, __ATOMIC_SEQ_CST);45 46 // First without forcing yield47 park_loop( this, id, false );48 49 // First with forcing yield50 park_loop( this, id, true );51 42 } 52 43
Note: See TracChangeset
for help on using the changeset viewer.