Re: A problem about programming with gtk+ in multiprocess.



>hello all,
>I have a problem when programming with gtk+ in multiprocess.
>please look follow codes :

what is is that has made some people think that this "fork, then have
the parent and the child continue to use GTK+" will work?

you cannot do this (reliably). X Window is inherently multithread
safe, and since the child and parent both share the same connection to
X server, using fork() rather than pthread_create() is just a detail
that doesn't really change what is going on: two contexts of execution
making parallel, unsynchronized requests to the X server on the same
connection.

we need to make it more clear that after fork(2), the child should never
access GTK structures or functions unless the parent never does so
again. can we add something to the FAQ about this?

--p



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