Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison VMS.c @ 174:c3f458403cd6
Always allocate more than 256 byte, measurements removed in master loop, aligned slots
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Tue, 20 Dec 2011 16:50:21 +0100 |
| parents | bfaebdf60df3 |
| children | de5e7c522f1f |
comparison
equal
deleted
inserted
replaced
| 83:09904d22c4aa | 84:b37d437e2ebb |
|---|---|
| 185 SchedSlot ** | 185 SchedSlot ** |
| 186 create_sched_slots() | 186 create_sched_slots() |
| 187 { SchedSlot **schedSlots; | 187 { SchedSlot **schedSlots; |
| 188 int i; | 188 int i; |
| 189 | 189 |
| 190 schedSlots = VMS__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); | 190 //schedSlots = VMS__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); |
| 191 posix_memalign(&schedSlots, CACHELINE_SIZE, NUM_SCHED_SLOTS * sizeof(SchedSlot *)); | |
| 191 | 192 |
| 192 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) | 193 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) |
| 193 { | 194 { |
| 194 schedSlots[i] = VMS__malloc( sizeof(SchedSlot) ); | 195 //schedSlots[i] = VMS__malloc( sizeof(SchedSlot) ); |
| 196 posix_memalign(&schedSlots[i], CACHELINE_SIZE, sizeof(SchedSlot) ); | |
| 195 | 197 |
| 196 //Set state to mean "handling requests done, slot needs filling" | 198 //Set state to mean "handling requests done, slot needs filling" |
| 197 schedSlots[i]->workIsDone = FALSE; | 199 schedSlots[i]->workIsDone = FALSE; |
| 198 schedSlots[i]->needsProcrAssigned = TRUE; | 200 schedSlots[i]->needsProcrAssigned = TRUE; |
| 199 } | 201 } |
| 588 // been alloc'd with VMS__malloc, or freed by the level above animPr. | 590 // been alloc'd with VMS__malloc, or freed by the level above animPr. |
| 589 //So, all that's left to free here is the stack and the VirtProcr struc | 591 //So, all that's left to free here is the stack and the VirtProcr struc |
| 590 // itself | 592 // itself |
| 591 //Note, should not stack-allocate initial data -- no guarantee, in | 593 //Note, should not stack-allocate initial data -- no guarantee, in |
| 592 // general that creating processor will outlive ones it creates. | 594 // general that creating processor will outlive ones it creates. |
| 593 //VMS__free( animatingPr->startOfStack ); | 595 free( animatingPr->startOfStack ); |
| 594 //VMS__free( animatingPr ); | 596 free( animatingPr ); |
| 595 } | 597 } |
| 596 | 598 |
| 597 | 599 |
| 598 //TODO: look at architecting cleanest separation between request handler | 600 //TODO: look at architecting cleanest separation between request handler |
| 599 // and master loop, for dissipate, create, shutdown, and other non-semantic | 601 // and master loop, for dissipate, create, shutdown, and other non-semantic |
