Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > ipc in java

Reply
Thread Tools

ipc in java

 
 
tom fredriksen
Guest
Posts: n/a
 
      03-21-2006

Does there exists any ipc mechanisms in java similar to what is
available in os's, such as pipes, shared memory etc. or is the only ipc
in java sockets and files?

/tom
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      03-21-2006
On Tue, 21 Mar 2006 03:12:27 +0100, tom fredriksen <>
wrote, quoted or indirectly quoted someone who said :

>
>Does there exists any ipc mechanisms in java similar to what is
>available in os's, such as pipes, shared memory etc. or is the only ipc
>in java sockets and files?


see http://mindprod.com/jgloss/remoteio.html
for a catalog of the tools. The main one is RMI. See
http://mindprod.com/jgloss/rmi.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      03-21-2006
On Tue, 21 Mar 2006 03:19:52 GMT, Roedy Green
< > wrote, quoted or
indirectly quoted someone who said :

>see http://mindprod.com/jgloss/remoteio.html


oops that should be:
http://mindprod.com/jgloss/remotefileaccess.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      03-21-2006
tom fredriksen wrote:
> Does there exists any ipc mechanisms in java


J2SE?

> similar to what is
> available in os's, such as pipes, shared memory etc.


No, although using named pipes via the Files class often works.

> or is the only ipc
> in java sockets and files?


Plus things on top of it, like CORBA and RMI. In J2EE you have things
like SOAP support (SAAJ, JAX-RPC).

But it is likely that you can find a JNI-based third party
implementation for almost every OS-specific IPC mechanism.


/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
 
Reply With Quote
 
tom fredriksen
Guest
Posts: n/a
 
      03-21-2006
Thomas Weidenfeller wrote:
> tom fredriksen wrote:
>
> But it is likely that you can find a JNI-based third party
> implementation for almost every OS-specific IPC mechanism.


I found one package which implemented posix ipc, "posix for java"

http://www.bmsi.com/java/posix/package.html


In any case it was more a question of curiosity as I had never heard of
it. I was thinking that some simple and common version of a couple
mechanisms could perhaps have been implemented java, if it could be an
abstracted implementation of what exists in current OS's. But I realise
that a hindrance is that java is not process oriented but rather thread
oriented. Which makes it a bit awkward to use.

/tom
 
Reply With Quote
 
EJP
Guest
Posts: n/a
 
      03-21-2006
Roedy Green wrote:

> http://mindprod.com/jgloss/remotefileaccess.html


and to this extensive list should be added java.nio.channels.Pipe. These
are not named pipes, they are more like Unix inter-process pipes (i.e. a
read pipe and a write pipe), but they are implemented under the hood
with sockets (as I believe Unix pipes are too actually).
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      03-22-2006
On Tue, 21 Mar 2006 23:25:26 GMT, EJP
<> wrote, quoted or indirectly quoted
someone who said :

>> http://mindprod.com/jgloss/remotefileaccess.html

>
>and to this extensive list should be added java.nio.channels.Pipe.


done.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
Nigel Wade
Guest
Posts: n/a
 
      03-22-2006
EJP wrote:

> Roedy Green wrote:
>
>> http://mindprod.com/jgloss/remotefileaccess.html

>
> and to this extensive list should be added java.nio.channels.Pipe. These
> are not named pipes, they are more like Unix inter-process pipes (i.e. a
> read pipe and a write pipe), but they are implemented under the hood
> with sockets (as I believe Unix pipes are too actually).


IIRC a pipe is equivalent to a socket in the UNIX domain rather than the INET
domain, and yes they use sockets. Because the sockets are in the UNIX (local)
domain a pipe is only available for IPC on the same host, there is no network
involvement. It's really only of use in communicating between parent/child
processes as the pipe has no ability to listen for connections. Both ends of
the socket are established when the pipe is created, within a single process.

Also, a pipe is uni-directional. To have 2-way communication requires two pipes.


--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail :
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      03-22-2006
Nigel Wade wrote:
> IIRC a pipe is equivalent to a socket in the UNIX domain rather than the INET
> domain, and yes they use sockets.


This all depends on the type of Unix pipe you are talking about, and on
the heritage of the particular Unix version.

Classic Unix pipes need not use sockets at all. In SVR4 these ones are
implemented on top of the streams io framework. In older AT&T Unix
version it was just some particular code in the kernel.

So called stream pipes are socked-based in BSD Unix systems, and simply
pipes-based in SVR4.

Regarding SVR4,

> Also, a pipe is uni-directional. To have 2-way communication requires two pipes.


here the normal pipe is already bi-directional (due to the
implementation on top of the streams io framework). When you ask for a
pipe, you always get a bi-directional one in SVR4. While on BSD systems
you have to ask for a socket pair to get a bi-directional one (or use
two normal pipes).

Of course, there are for sure Unix dialects where this is done differently.

And you of course also have named pipes (FIFOs) and you can associate a
name with a stream pipe.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
 
Reply With Quote
 
Nigel Wade
Guest
Posts: n/a
 
      03-23-2006
Thomas Weidenfeller wrote:

> Nigel Wade wrote:
>> IIRC a pipe is equivalent to a socket in the UNIX domain rather than the INET
>> domain, and yes they use sockets.

>
> This all depends on the type of Unix pipe you are talking about, and on
> the heritage of the particular Unix version.
>
> Classic Unix pipes need not use sockets at all. In SVR4 these ones are
> implemented on top of the streams io framework. In older AT&T Unix
> version it was just some particular code in the kernel.
>
> So called stream pipes are socked-based in BSD Unix systems, and simply
> pipes-based in SVR4.


It's been a while since I did any programming requiring pipes. In those days the
pipe system call returned a pair of file descriptors, one for read and one for
write. It was the responsibility of the programmer to ensure that the correct
end of each was closed in the parent/child to allow correct communications.

As in all fields, progress has been made (but not necessarily in the
documentation). According to the man pages for Linux/IRIX/Solaris the pipe
system call still returns a classic, uni-directional pipe. To further confuse
matters IRIX implements 2 versions of pipe, one with the conventional SVR3.2
uni-directional semantics and another with the bi-directional SVR4 semantics,
controlled either by a kernel tunable parameter, or the library linked at
runtime.

Which type of pipe is really returned remains a mystery...

>
> Regarding SVR4,
>
>> Also, a pipe is uni-directional. To have 2-way communication requires two

pipes.
>
> here the normal pipe is already bi-directional (due to the
> implementation on top of the streams io framework). When you ask for a
> pipe, you always get a bi-directional one in SVR4. While on BSD systems
> you have to ask for a socket pair to get a bi-directional one (or use
> two normal pipes).



Sorry, what I meant to say was that Pipe is uni-directional. According to the
API Javadocs it implements a uni-directional pipe.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail :
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message Queues for IPC in Java? dimitrik107@hotmail.com Java 3 08-19-2006 11:30 PM
Java IPC Query Gordon Beaton Java 4 12-01-2005 08:23 AM
File Sharing IPC$ Problem =?Utf-8?B?SmltIE1jQ29sbA==?= Wireless Networking 7 10-25-2004 09:31 PM
IPC Mechanism Named pipes or Windows messages or sthg else ? piyush ASP .Net 0 07-14-2004 02:41 PM
Java IPC Day9901 Java 1 02-07-2004 03:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57