The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
msgchannel.h
Go to the documentation of this file.
1 
30 #pragma once
31 
32 #include <core/core.h>
33 
34 struct _msg_buff {
35  msg_t *volatile *buffer;
36  volatile unsigned int size;
37  volatile unsigned int written;
38  volatile unsigned int read;
39 };
40 
41 typedef struct _msg_channel {
42  struct _msg_buff *volatile buffers[2];
43  atomic_t size;
44  spinlock_t write_lock;
45 } msg_channel;
46 
47 #define INITIAL_CHANNEL_SIZE (512)
48 
49 extern msg_channel *init_channel(void);
50 extern void fini_channel(msg_channel *);
51 extern void insert_msg(msg_channel *, msg_t *);
52 extern void *get_msg(msg_channel *);
Core ROOT-Sim functionalities.
Message Type definition.
Definition: core.h:164