This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Last version of message queues.


Hi Aurelio,

Last time I looked you needed PTHREAD_PROCESS_SHARED mutexes
and condition variables. The code you just sent does the same
as last time.

_POSIX_THREAD_PROCESS_SHARED isn't defined in pthreads-win32, nor
in Linux I believe (although I could be out of date there).

For example, in  mq_open() you have the following code:

	if ( (i = pthread_mutexattr_init(&mattr)) != 0)
	   goto pthreaderr;
	pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED);
	i = pthread_mutex_init(&mqhdr->mqh_lock, &mattr);
	pthread_mutexattr_destroy(&mattr);      /* be sure to destroy */
	if (i != 0)
	   goto pthreaderr;
 
	if ( (i = pthread_condattr_init(&cattr)) != 0)
	   goto pthreaderr;
	pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED);
	i = pthread_cond_init(&mqhdr->mqh_wait, &cattr);

The *attr_setpshared() calls will be returning ENOSYS errors.

Ross

Aurelio Medina wrote:
> 
> Here is my latest port of the POSIX message queue interface.  I contributed
> my code to PThreads-Win32 some time ago.  I'm not sure if its available on
> the Web Site.
> 
> Anyhow,  I'm using this implementation along with Pthreads-Win32 in a
> production real-time trading application with no problems.
> 
> Hope this helps,
> Aurelio Medina
> 
> -----Original Message-----
> From: Le Coent Yannick [mailto:Yannick.LeCoent@srit.siemens.fr]
> Sent: Thursday, August 02, 2001 9:27 AM
> To: pthreads-win32@sourceware.cygnus.com
> Subject: Last version of message queues.
> 
> Hello,
> 
> Can anyone tell me where I could find the latest sources for the message
> queues?
> 
> Thanks a lot,
> Yannick LE COENT
> SIEMENS Réseaux Informatiques et Télécommunications
> 3, rue Blaise Pascal
> F - 22300 LANNION
> 
> Tel.:   +33-2-96 48 74 26
> Fax:    +33-2-96 48 74 73
> E-mail: Yannick.LeCoent@srit.siemens.fr
> <mailto:Yannick.LeCoent@srit.siemens.fr>
> 
>   ------------------------------------------------------------------------
>                Name: mqueue.c
>    mqueue.c    Type: unspecified type (application/octet-stream)
>            Encoding: quoted-printable
> 
>    mqueue.hName: mqueue.h
>            Type: unspecified type (application/octet-stream)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]