[732] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

About PTHREAD_PROCESS_SHARED

daemon@ATHENA.MIT.EDU (Zhenhai Duan)
Thu Oct 23 23:22:39 1997

Date: Thu, 23 Oct 1997 22:01:18 -0500 (CDT)
From: Zhenhai Duan <duan@cs.umn.edu>
To: pthreads@MIT.EDU, proven@MIT.EDU

Hi,
	I know that conditional variable can be used inter-process,
	but need to initialized with PTHREAD_PROCESS_SHARED,and should
	be in the shared memory. But I do not know how to do that, I 
	just use:

 	pthread_condattr_init(&cv_attr);
        if ((n=pthread_condattr_setpshared(&cv_attr,
                        PTHREAD_PROCESS_SHARED))!=0){
                fprintf(stderr, "condattr wrong");
                exit(1);
        }
        if ((n=pthread_cond_init(&EmptyCond,&cv_attr))!=0){
                fprintf(stderr, "cond_init");
                exit(1);
        }

	What other things should I do?
	
	Thank you!


--Jan Z.H.Duan
--------------------------------------------------------------
Department of Computer Science   duan@cs.umn.edu
University of Minnesota          http://www.cs.umn.edu/~duan/
Tel. 612-6267526(Office)
-------------------------------------------------------------- 


home help back first fref pref prev next nref lref last post