Revision 96cc8d6f

View differences:

configure.user
18 18
#    yes -> no NOT use barrier messages
19 19
#    no  -> use barrier messages
20 20
#
21
NOBARRIER=no
21
NOBARRIER=yes
22 22
#
23 23
# In combination with NOBARRIER: Define the cache line size used for aligning
24 24
# synchronization data structures to cache line borders.
include/cspinningthreadpool.h
43 43
	/**
44 44
	 * Stores the state of a thread. Using struct for padding to cache line.
45 45
	 */
46
	typedef struct threadState_t
46
	struct threadState_t
47 47
	{
48 48
		AO_t msg;
49 49
		simtime_t barrierTime;
......
51 51
#ifdef CACHE_LINE_SIZE
52 52
		char padding[CACHE_LINE_SIZE-sizeof(AO_t)-sizeof(simtime_t)-sizeof(int)];
53 53
#endif
54
	} threadState_t;
54
	};
55 55

  
56 56

  
57 57
	/**
include/cthreadpool.h
24 24
#include "cmessageheap.h"
25 25
#include <pthread.h>
26 26

  
27
class cThreadPool;
28 27
class cThreadLocalData;
29 28
class cMessage;
30 29
class cComponent;
src/sim/cspinningthreadpool.cc
125 125
        //
126 126
        while ((event = AO_load_read(&threadStates[threadId].msg)) == 0)
127 127
        {
128
            __asm__ ("pause");
128
            __asm__ __volatile__ ("pause");
129 129
        }
130 130

  
131 131
        if (AO_load_read(&cancel) == 1)
......
163 163
    if (barrierMin >= 0)
164 164
    {
165 165
        if (threadStates[barrierMin] < *msg)
166
            while (BARRIERVALID(barrierMin)) {__asm__ ("pause");}
166
            while (BARRIERVALID(barrierMin)) {__asm__ __volatile__ ("pause");}
167 167
        else
168 168
            return;
169 169
    }
......
200 200
        // wait at the next valid barrier if needed of return new barrier pointer
201 201
        //
202 202
        if (barrierMin >= 0 && threadStates[barrierMin] < *msg)
203
            while ((BARRIERVALID(barrierMin))) {__asm__ ("pause");}
203
            while ((BARRIERVALID(barrierMin))) {__asm__ __volatile__ ("pause");}
204 204
        else
205 205
            return;
206 206

  
......
262 262
        std::cout << "waiting for thread " << i << std::endl;
263 263
        while (AO_load_read(&threadStates[i].msg) != 0)
264 264
        {
265
            __asm__ ("pause");
265
            __asm__  __volatile__ ("pause");
266 266
        }
267 267
        AO_store_write(&threadStates[i].msg, 1);
268 268
        pthread_join(workerIDs[i], NULL);
src/sim/cstopwatch.cc
1 1
//==========================================================================
2
//  CSTOPPWATCH - part of
2
//  CSTOPWATCH - part of
3 3
//                     OMNeT++/OMNEST
4 4
//            Discrete System Simulation in C++
5 5
//
6 6
//
7 7
//  Declaration of the following classes:
8
//    cStoppwatch: measures the time interval between invocations
8
//    cStopwatch: measures the time interval between invocations
9 9
//
10 10
//==========================================================================
11 11

  

Also available in: Unified diff