int main(int argc, char** argv){ int pid = getpid(); pthread_t *my_threads = malloc(sizeof(pthread_t) * NUM_THREADS); char testme = 't'; printf ("multi thread - init arsc \n"); init_arc(&SYS_CHANNEL); for (int i = 0; i < NUM_THREADS ; i++) pthread_create(&my_threads[i], NULL, &syscall_thread, NULL); for (int i = 0; i < NUM_THREADS; i++){ pthread_join(my_threads[i], NULL); } printf("multi thread - end\n"); }
int main(int argc, char** argv){ int pid = sys_getpid(); char testme = 't'; printf ("single thread - init arsc \n"); syscall_desc_t* sysdesc[2]; syscall_rsp_t sysrsp; init_arc(&SYS_CHANNEL); printf ("single thread - init complete \n"); // cprintf_async(&desc1, "Cross-Core call 1, coming from process %08x\n", pid); sysdesc[0] = sys_cputs_async(&testme, 1, NULL, NULL); sysdesc[1] = sys_cputs_async(&testme, 1, NULL, NULL); printf ("single thread - call placed \n"); //ignore return value assert(-1 != waiton_syscall(sysdesc[0])); assert(-1 != waiton_syscall(sysdesc[1])); printf ("single thread - dummy call \n"); }
arc_t* new_arc(){ arc_t *narc = (arc_t *)malloc(sizeof(arc_t)); init_arc(narc); return narc; }