is there any way to get the value of a semaphore whose value is set in perl and it needs to be accessed in java by some other program . OR . system has its shared memory .Can it be used in java .I dont know the code and also that memory id should be known because it has to be accessed in perl program ......... need this stuff urgently ...
Actually a file is being written by aperl program and being read by a java program ... to avoid any dirty reads it has to have some shared memory or semaphore kind of stuff .... and i am new to java so dont know that a semaphore or a shared memory can be accessed in java which is having a particular id .....HELP !!
pascal betz
Ranch Hand
Joined: Jun 19, 2001
Posts: 547
posted
0
no, you can not access any shared memory...
but there are several other ways you can avoid dirty reads...
- if you are in control of the file format, place a special EOF sequence at the end of file and the java program can check against this sequence - after the file is written, add it's name to a file... and only scan this file for changes and then if a new name appears, process the file - after the file is written add a <FILENAME>.done file to flag the java program it can start processing the original file - write a small "server" app that listens on a specified port and then let your perl program send a "message" to this port. or use SOAP or another "inter-language" communication - -
it just depends on what your goal is...
p
Roy Simon
Ranch Hand
Joined: Aug 26, 2005
Posts: 62
posted
0
hi, u can communicate with other java programs using sockets or RMI.. Regards Simon