comp.lang.ada
 help / color / mirror / Atom feed
* ADA vs. C++ Shared Memory
@ 1998-09-01  0:00 kelch
  1998-09-02  0:00 ` Stephen Leake
  0 siblings, 1 reply; 6+ messages in thread
From: kelch @ 1998-09-01  0:00 UTC (permalink / raw)


Hy !!

Is it possible to create a shared memory between ADA and C++.
If anyone know how, please report me

Best Regards
W.Kelch

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




^ permalink raw reply	[flat|nested] 6+ messages in thread

* ADA vs. C++ Shared Memory
@ 1998-09-01  0:00 Wolfgang.Kelch
  1998-09-01  0:00 ` John McCabe
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang.Kelch @ 1998-09-01  0:00 UTC (permalink / raw)


Hy!!


Is there a possibility to connect a ADA and a C++ process with a
shared Memory. Have onyone experience in this topic.

Best Regards
W.Kelch

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ADA vs. C++ Shared Memory
  1998-09-01  0:00 Wolfgang.Kelch
@ 1998-09-01  0:00 ` John McCabe
  0 siblings, 0 replies; 6+ messages in thread
From: John McCabe @ 1998-09-01  0:00 UTC (permalink / raw)



>Is there a possibility to connect a ADA and a C++ process with a
>shared Memory. Have onyone experience in this topic.

Shared memory applications are really operating system dependant so you 
will need to read your operating system manuals to work out how to do it.

If you are using a (substantially) POSIX compliant Unix then you might 
want to check out the manual pages for:

shm_open
mmap
ftruncate
munmap
shm_unlink
close

These should give you an idea of how you would link C/C++ programs using 
shared memory. You could then get hold of the Ada POSIX bindings 
(Florist) and then either build them using GNAT, or use them as a basis 
for creating your own application (all you're really doing is importing 
some of the C functions and putting a wrapper round it).

My advice would be to make sure you can get two very simple C/C++ 
programs communicating and then effectively convert one of them into Ada!

Hope this helps.

-- 
Best Regards
John McCabe

=====================================================================
Not necessarily my company or service providers opinions.
=====================================================================






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ADA vs. C++ Shared Memory
  1998-09-01  0:00 ADA vs. C++ Shared Memory kelch
@ 1998-09-02  0:00 ` Stephen Leake
  1998-09-03  0:00   ` Jerry van Dijk
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Leake @ 1998-09-02  0:00 UTC (permalink / raw)


kelch@my-dejanews.com writes:

> Hy !!
> 
> Is it possible to create a shared memory between ADA and C++.
> If anyone know how, please report me

If you mean "shared variables between an Ada module and a C++ module",
that's easy, just export a variable from Ada using convention C, and
declare the same variable in C++ using "extern C". Then link the code
together into one executable, and voila.

If you mean "shared memory between one process running Ada code and
another process running C++ code", that's operating system and
compiler dependent.

The single executable approach is much simpler, and much more
portable.

-- Stephe




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ADA vs. C++ Shared Memory
  1998-09-02  0:00 ` Stephen Leake
@ 1998-09-03  0:00   ` Jerry van Dijk
  1998-09-04  0:00     ` John McCabe
  0 siblings, 1 reply; 6+ messages in thread
From: Jerry van Dijk @ 1998-09-03  0:00 UTC (permalink / raw)


Stephen Leake (Stephen.Leake@gsfc.nasa.gov) wrote:

: If you mean "shared memory between one process running Ada code and
: another process running C++ code", that's operating system and
: compiler dependent.

Doesn't florist include this ?

Jerry.

-- 
-- Jerry van Dijk  | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada
-- Ada & Win32: http://stad.dsl.nl/~jvandyk




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ADA vs. C++ Shared Memory
  1998-09-03  0:00   ` Jerry van Dijk
@ 1998-09-04  0:00     ` John McCabe
  0 siblings, 0 replies; 6+ messages in thread
From: John McCabe @ 1998-09-04  0:00 UTC (permalink / raw)


jerry@jvdsys.nextjk.stuyts.nl (Jerry van Dijk) wrote:
>Stephen Leake (Stephen.Leake@gsfc.nasa.gov) wrote:
>
>: If you mean "shared memory between one process running Ada code and
>: another process running C++ code", that's operating system and
>: compiler dependent.
>
>Doesn't florist include this ?

Yes, but that's operating system and compiler dependant :-) Well, to some 
extent anyway. Florist will provide interfaces to the POSIX system, but 
if your OS is not POSIX compliant, then Florist is not of much use to 
you. Also, if you have got a SUN/Solaris/GNAT system, Florist is 
apparently really easy to build and use, anything else could cause 
hassle. I, for example, had trouble building it on an Irix system, 
although that may only be as a result of the kernel configuration!

-- 
Best Regards
John McCabe

=====================================================================
Not necessarily my company or service providers opinions.
=====================================================================






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1998-09-04  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-01  0:00 ADA vs. C++ Shared Memory kelch
1998-09-02  0:00 ` Stephen Leake
1998-09-03  0:00   ` Jerry van Dijk
1998-09-04  0:00     ` John McCabe
  -- strict thread matches above, loose matches on Subject: below --
1998-09-01  0:00 Wolfgang.Kelch
1998-09-01  0:00 ` John McCabe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox