rt_benchs/communication_techniques/include/pipe_comm.h

28 lines
419 B
C

#ifndef _SPECIFIC_COMM_H_
#define _SPECIFIC_COMM_H_ 1
#include <unistd.h>
#define READ_IDX 0
#define WRITE_IDX 1
struct thread_comm
{
int *pipefd;
};
__BEGIN_DECLS
extern __thread int pipefd[];
extern struct thread_comm *tcomms;
int init_thread_comm(struct thread_comm *);
int end_thread_comm(void);
static inline void send(void **addr) {
write(pipefd[WRITE_IDX], &addr, sizeof(void *));
}
__END_DECLS
#endif