Changeset 3d19ae6
- Timestamp:
- Dec 21, 2020, 4:40:48 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:
- 8339225
- Parents:
- 7b1f6d4
- Location:
- benchmark/readyQ
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/locality.go
r7b1f6d4 r3d19ae6 18 18 // ================================================== 19 19 type MyData struct { 20 _p1 [16]uint64 // padding 20 21 ttid int 21 22 id int 22 23 data [] uint64 24 _p2 [16]uint64 // padding 23 25 } 24 26 … … 29 31 data[i] = 0 30 32 } 31 return &MyData{ syscall.Gettid(), id, data}33 return &MyData{[16]uint64{0}, syscall.Gettid(), id, data,[16]uint64{0}} 32 34 } 33 35 … … 46 48 // ================================================== 47 49 type MyCtx struct { 50 _p1 [16]uint64 // padding 48 51 s * semaphore.Weighted 49 52 d unsafe.Pointer … … 51 54 ttid int 52 55 id int 56 _p2 [16]uint64 // padding 53 57 } 54 58 55 59 func NewCtx( data * MyData, id int ) (MyCtx) { 56 r := MyCtx{ semaphore.NewWeighted(1), unsafe.Pointer(data), context.Background(), syscall.Gettid(), id}60 r := MyCtx{[16]uint64{0},semaphore.NewWeighted(1), unsafe.Pointer(data), context.Background(), syscall.Gettid(), id,[16]uint64{0}} 57 61 r.s.Acquire(context.Background(), 1) 58 62 return r … … 73 77 ptr uintptr // atomic variable use fo MES 74 78 id int // id for debugging 79 _p [16]uint64 // padding 75 80 } 76 81 … … 239 244 channels := make([]Spot, nthreads - nprocs) // Number of spots 240 245 for i := range channels { 241 channels[i] = Spot{uintptr(0), i } // init spots246 channels[i] = Spot{uintptr(0), i,[16]uint64{0}} // init spots 242 247 } 243 248 -
benchmark/readyQ/locality.rs
r7b1f6d4 r3d19ae6 53 53 // ================================================== 54 54 struct MyCtx { 55 _p1: [16]u64, 55 56 s: sync::Semaphore, 56 57 d: MyDataPtr, 57 58 ttid: ThreadId, 58 59 _id: usize, 60 _p2: [16]u64, 59 61 } 60 62
Note: See TracChangeset
for help on using the changeset viewer.