Re: Accessing shared memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-03-29 at 17:04 -0500, holtrk85 wrote:
> I have a Windows based application that was written by my customer.
> This application receives data via UDP, massages the data(proprietary
> algorithm), then stuffs the output into a shared memory segment.  This
> app runs perfectly using Wine on my Linux box(Fedora 12).
> 
> My own development environment is Java.  I need to write a piece of
> native C code that can get at the shared memory segment that is
> created by my customer's application using shmat().
> 
> Does anyone have any idea how to tackle this issue?
> 
Sounds like you'll need to use the JVM's JNI API. See your JDK's
documentation set for the JNI documentation.

Have you and your customer considered using a socket rather than shared
memory to pass information between the programs? That is generally an
easier interface to manage when Java needs to talk to a program written
in another language. You don't say whether your code will always run
under Linux or if it is intended to run in a Windows environment in
future. If the latter you're definitely better off using sockets because
the C code used to write the JNI extensions to the JVM is OS-specific,
so it will not be portable between Linux and Windows.

This thread appears more to do with Java than Wine, so I suggest you
post any additional questions on comp.lang.java.programmer rather than
here.


Martin





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux