Communication techniques bench: add fake comm

This commit is contained in:
Thomas Preud'homme 2009-06-17 15:47:12 +02:00 committed by Thomas Preud'homme
parent 3059605ed4
commit 68589566a7
3 changed files with 56 additions and 1 deletions

View File

@ -18,7 +18,7 @@ LDFLAGS=-L$(LIBDIR) -L$(LOCALDIR)/$(PAPIHIGHLEVELLIBDIR) -Wl,-rpath-link,$(HOME)
CC=gcc
# Files
BINNAMES=asm_cache_comm c_cache_comm pipe_comm shared_mem_comm shared_mem_opt_comm jikes_barrier_comm
BINNAMES=asm_cache_comm c_cache_comm pipe_comm shared_mem_comm shared_mem_opt_comm jikes_barrier_comm fake_comm
BINS=$(patsubst %, $(BINDIR)/%, $(BINNAMES))
MAIN_OBJS=main.o common.o
COMMON_LIB_OBJS=common.o

View File

@ -0,0 +1,30 @@
#ifndef __COMM_H_
#define __COMM_H_ 1
#include <stdint.h>
/* Non standard include */
#include <common_comm.h>
#define FAKE_NURSERY_START 1
struct communication_assoc
{
struct communication_assoc *next;
struct communication_assoc *prev;
pthread_t tid;
};
extern struct communication_assoc assoc_root;
__BEGIN_DECLS
struct communication_assoc *create_comm_assoc(void);
static inline void send(void **addr) {
static __thread void **store_var = NULL;
store_var = addr;
}
__END_DECLS
#endif

View File

@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
/* Non standard include */
#include <common_comm.h>
#include <specific_comm.h>
struct communication_assoc *create_comm_assoc(void)
{
struct communication_assoc *assoc;
assoc = (struct communication_assoc *) malloc(sizeof(struct communication_assoc));
assoc->tid = pthread_self();
return assoc;
}
void reception(void (*on_receive)(void *))
{
wait_initialization();
/* printf("Activate the consumer...\n"); */
while (cont);
}