Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Named pipe really full duplex ?

451 views
Skip to first unread message

Nicolas Cadilhac

unread,
Jan 31, 2004, 9:14:26 AM1/31/04
to
Hi,

I know that I can create a bi-directional named pipe. My question is more
"in a server can I have a thread that waits on a read and another thread
that writes to the pipe, while in the client a thread writes to the pipe ?
ie can 2 messages transit in 2 directions without colliding ? or must
full-duplex be understood like "you can read and write on a pipe but not at
the same time".

Thank you

Nicolas


Slobodan Brcin (eMVP)

unread,
Jan 31, 2004, 10:15:27 AM1/31/04
to
Nicolas,

They must be full duplex, because the following scenario:
Two processes with two treads. You have one handle to pipe in each process.
Both process threads have access to same handle so one thread can write and
other thread can read from same pipe at the same time on the SMP machines.
Same goes for other process as well.

If your question is more like can you use overlapped access, then this would
be probably also possible but not with standard CreatePipe.

Regards,
Slobodan


"Nicolas Cadilhac" <cadilha...@sympatico.ca> wrote in message
news:bLOSb.45251$mf4.1...@news20.bellglobal.com...

Nicolas Cadilhac

unread,
Jan 31, 2004, 10:47:50 AM1/31/04
to
what do you mean by "not with standard CreatePipe" ?

Thanks you

Slobodan Brcin (eMVP)

unread,
Jan 31, 2004, 8:54:24 PM1/31/04
to
> what do you mean by "not with standard CreatePipe" ?

I don't know. There is always a way to find some native API function that
can be used to accomplish this purpose. But in this case I would not
recommend wasting the time to do this because I fail to see purpose of
request for this feature.

Why do you need this? We may find another way to do what ever is that you
want to do.

Regards,
Slobodan

"Nicolas Cadilhac" <cadilha...@sympatico.ca> wrote in message

news:r6QSb.45888$mf4.1...@news20.bellglobal.com...

Mike

unread,
Feb 1, 2004, 10:46:23 AM2/1/04
to
You can use Overlapped IO on any IFS handle.
A named pipe is an IFS handle.

Everything is fine if you read only from one thread and write only from one
thread. Problems arise if you try to read from two threads or write from
two threads.

"Slobodan Brcin (eMVP)" <sbr...@ptt.yu> wrote in message
news:eFewlYG6...@TK2MSFTNGP09.phx.gbl...

Arkady Frenkel

unread,
Feb 1, 2004, 1:56:04 PM2/1/04
to
Really , that usual socket problem and because pipes used sockets the same
problem arise too.
Arkady

"Mike" <m@b.c> wrote in message
news:On5$7oN6DH...@TK2MSFTNGP10.phx.gbl...

Kirk Ferdmann

unread,
Feb 1, 2004, 10:02:09 PM2/1/04
to
"Slobodan Brcin (eMVP)" <sbr...@ptt.yu> wrote in message
news:uc2ClzA6...@tk2msftngp13.phx.gbl...

> If your question is more like can you use overlapped access, then this
would
> be probably also possible but not with standard CreatePipe.

For overlapped pipe IO one has to use named pipes.

-Kirk


Slobodan Brcin (eMVP)

unread,
Feb 1, 2004, 10:08:49 PM2/1/04
to
CreateNamedPipe, right and this was the original question :$
Shame on me.

I haven't used them for a while, and I never needed overlapped access on
pipes.

Thanks,
Slobodan

"Kirk Ferdmann" <kirk_f...@nospam.hotmail.com> wrote in message
news:Er6dnRw-upD...@comcast.com...

0 new messages