This is the mail archive of the
mailing list for the pthreas-win32 project.
RE: POSIX Message Queues for Win32!
- To: "'aurelio dot medina at bankofamerica dot com'" <aurelio dot medina at bankofamerica dot com>, rpj at ise dot canberra dot edu dot au
- Subject: RE: POSIX Message Queues for Win32!
- From: "Bossom, John" <John dot Bossom at Cognos dot COM>
- Date: Fri, 13 Oct 2000 11:07:41 -0400
- Cc: jramirez at tct dot hut dot fi, pthreads-win32 at sourceware dot cygnus dot com
First of all, I think it is great that you are contributing
this MQ code to open source.
As I have pointed out to Ross, however, I don't believe that the
MQ source should be integrated into the pthreads-win32 library.
Instead, I believe it should be it's own library that requires the
I have two reasons for this:
1) MQs are not part of PThreads. The PThreads-win32 project was
to provide an implementation of POSIX-1003.1c-1995 (i.e. POSIX.4a)
with the addition of semaphores, from POSIX 1003.1b-1993.
MQs are part of POSIX.4
Adding MQ's to pthreads-win32 will basically permut the project
into a repository for all POSIX.4 features; thus it will no
longer be focused on PThreads, specifically.
2) It prevents users from picking and choosing what components
they wish/need. A PThreads client may not want MQ's.
Even on Solaris, the message queues are part of the posix4 library
while the pthreads library is separate.
i.e. to link against both PThreads and MQ's on Solaris, you would
have to specify
My recommendation is to start a new project that provides MQ's
Sent: Friday, October 13, 2000 10:19 AM
Cc: firstname.lastname@example.org; email@example.com
Subject: POSIX Message Queues for Win32!
Since I never actually tested my Win32 port of POSIX Message Queues I had no
idea how close I actually was. Much to my surprise, I am glad to announce
that the source code provided below is now indeed very functional. I have
tested this code with the file 'tester.c' using of course the PThreads-Win32
library and it worked great.
I'd like to provide a little history and notes about this source code.
1) I used Richard Steven's (May he RIP) POSIX MQ implementation using UNIX
memory mapped I/O as the base source code.
2) I then had to make a few very minor changes to port it to HP-UX 10.x.
3) I used this code in an in-house UNIX application at work that heavily
tested this code and it never once broke.
4) Thinking I would also need to port this application to Windows NT I
ported the POSIX MQ library to Win32 using Win32 memory mapped I/O. Since I
never did port my application to Windows NT I never got to test my ported
5) Finally I decided to see just how close I was to having functional code.
In my opinion this code is about 90% functional and can be made available as
is. See "Things left to be done" below.
6) This code can be used on Win32 as well as UNIX platforms.
7) This code was compiled using MS Visual C++ 6.0.
POSIX Message Queue functions implemented:
Thing left to be done:
1) Integrate into the current PThread-Win32 library.
2) Implement mq_notify(), this could be tough. Anyone up for the challenge?
3) Provide more test cases.
4) Build using other compilers?
Finally, given the fact that most of this MQ source code has been heavily
tested by my in-house application on UNIX, I am fairly confident that the
Win32 port should be stable. But please do test some more.
<<mqueue.h>> <<mqueue.c>> <<tester.c>>
> -----Original Message-----
> From: Ross Johnson [SMTP:firstname.lastname@example.org]
> Sent: Wednesday, October 11, 2000 6:55 PM
> To: Medina, Aurelio
> Cc: email@example.com; firstname.lastname@example.org
> Subject: Re: Message queues
> I'm going to make a special note to myself to include Aurelio's
> starting code in the next snapshot, which is what I should have done
> already - sorry. And I'll try to get it out as soon as I can - say,
> by next monday.
> email@example.com wrote:
> > Julio,
> > At one point I sent in my draft code implementing POSIX Message Queues
> > Win32 hoping that someone can complete it. I may be able to finish it
> in a
> > month or two but my work schedule makes it tough to do.
> > Has anyone touched the source code that I sent to the PThreads-Win32
> > list. If there is enough interest in POSIX MQs for Win32 I may try to
> > complete it. I have benefitted from this effort and I might be able to
> > contribute more if there is enough interest.
> > Aurelio Medina
> > > -----Original Message-----
> > > From: Julio [SMTP:firstname.lastname@example.org]
> > > Sent: Wednesday, October 11, 2000 5:29 AM
> > > To: 'Pthreads-win32'
> > > Subject: Message queues
> > >
> > > Sorry, this may be offtopic.
> > >
> > > Could someone tell me where can I find Win32 POSIX libraries for
> > >
> > > queues??
> > >
> > > Thnx.