On Thu, Mar 17, 2011 at 11:46:56AM +0000, Dietmar Maurer wrote:
> > i wonder if i can reuse a connection after a fork?
> >
> > conn = qb_ipcc_connect(..)
> > cpid = fork();
> > if (cpid) {
> > qb_ipcc_sendv_recv(conn, ..)
> > else {
> > qb_ipcc_sendv_recv(conn, ..)
> > }
> >
> > I guess each process needs its own connection instead?
>
> Yes a connection for each process, both clients sharing one block of shared
> mem is't going to work well.
Would it be possible to detect such mistake in qb_ipcc_sendv_recv() (simply check if the
pid has changed)?
Currently above code works without and error, but can lead to strange bugs.
Does getpid() has any perf. penalty? If not then yes.
-Angus
- Dietmar
_______________________________________________
quarterback-devel mailing list
quarterback-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/quarterback-devel