Changeset 3f8baf4 for benchmark/readyQ/locality.rs
- Timestamp:
- Dec 21, 2020, 6:00:05 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- fe97de26
- Parents:
- 7efb322
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/locality.rs
r7efb322 r3f8baf4 17 17 // ================================================== 18 18 struct MyData { 19 _p1: [u64; 16], 19 20 data: Vec<u64>, 20 21 ttid: ThreadId, 21 22 _id: usize, 23 _p2: [u64; 16], 22 24 } 23 25 … … 25 27 fn new(id: usize, size: usize) -> MyData { 26 28 MyData { 29 _p1: [0; 16], 27 30 data: vec![0; size], 28 31 ttid: thread::current().id(), 29 32 _id: id, 33 _p2: [0; 16], 30 34 } 31 35 } … … 53 57 // ================================================== 54 58 struct MyCtx { 55 _p1: [ 16]u64,59 _p1: [u64; 16], 56 60 s: sync::Semaphore, 57 61 d: MyDataPtr, 58 62 ttid: ThreadId, 59 63 _id: usize, 60 _p2: [ 16]u64,64 _p2: [u64; 16], 61 65 } 62 66 … … 64 68 fn new(d: *mut MyData, id: usize) -> MyCtx { 65 69 MyCtx { 70 _p1: [0; 16], 66 71 s: sync::Semaphore::new(0), 67 72 d: MyDataPtr{ ptr: d }, 68 73 ttid: thread::current().id(), 69 _id: id 74 _id: id, 75 _p2: [0; 16], 70 76 } 71 77 } … … 83 89 // May exchanges data 84 90 struct MySpot { 91 _p1: [u64; 16], 85 92 ptr: AtomicU64, 86 93 _id: usize, 94 _p2: [u64; 16], 87 95 } 88 96 … … 90 98 fn new(id: usize) -> MySpot { 91 99 let r = MySpot{ 100 _p1: [0; 16], 92 101 ptr: AtomicU64::new(0), 93 102 _id: id, 103 _p2: [0; 16], 94 104 }; 95 105 r
Note: See TracChangeset
for help on using the changeset viewer.