remote function with pthread

Posted by user311130 on Stack Overflow See other posts from Stack Overflow or by user311130
Published on 2010-05-22T09:45:37Z Indexed on 2010/05/22 9:50 UTC
Read the original article Hit count: 273

Filed under:
|

Hi all,

I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first).

#include <pthread.h>
#include "starter.h"
#include "UI.h"

Page* MM;
Page* Disk;
PCB* all_pcb_array;

void* display_prompt(void *id){

    printf("Hello111\n");

    return NULL;
}


int main(int argc, char** argv) {
    printf("Hello\n");
    pthread_t *thread = (pthread_t*) malloc (sizeof(pthread_t));
    pthread_create(thread, NULL, display_prompt, NULL);
    printf("Hello\n");
    return 1;
}

that works fine. However, when I move display_prompt to UI.h no "Hello111 " output is printed.

anyone know how to solve that? Elad

© Stack Overflow or respective owner

Related posts about c

    Related posts about multithreading