multithread--how can I update two text widgets in a window concurrently?



Dear Sirs,
 
I am designing a pop3 client which can get mails of multiserver concurrently.
I try to call fork() , but I failed.
Can I use this system call "fork()"?
Hereafter is my code.
Please help me to fix it.
Thanks a lot!!
 
************************************************************
void get_mail(GtkWidget *window)        /*window has two text widget*/
{
    for (int i = 0; i < 2; i++){
        switch (fork()){
                case 0:
                                /* get mail and update text[i] */
                         exit();
            case -1:
                        exit();
            default:
                        break;
        }
    } 
}
***********************************************************
compile time is ok!
run time error messages as follow:
GdkERROR: BadIDChoice(Invalid resource ID chosen for this connectione)
    serial 171 error_code 14 request_code 1 minor_code 0
            173                  14                    1                   0
            175                  14                    1                   0
                226                        13                            60                        0
            227                 13                     60                 0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]