On Thu, 26 Aug 1999, Phil Wilshire wrote:

> found 
> out that ther was no easy way to share commons between different Fortran
> Programs.

Get rid of Fortran, translate to C. (OK, I know it can be unrealistic). But
please at least do not pollute the world with even more Fortran code :-(

> I have reserved 2M of memory at boot time using lilo.
> I can access this happily with a normal C program.

If you are not interested in using the same from kernel space you might want
to use shmget/shmat commands syscalls.

> I now want to force a fortran common to occupy that space.
> For now I can leavemost of the fortran out.

So you want multithreading Fortran. But are you sure that the compiler will
not optimize the repeated accesses to the common block out? How to use
"volatile" in Fortran?

>   ptr = (int *) mmap((void *)sm_base, sm_size, PROT_READ | PROT_WRITE,
>                           MAP_FILE | MAP_SHARED, memd, sm_base);

I do not like (void *)sm_base - I would use some safer address for "to" mmap
address. See where it is mmapped with 0 as first argument and use value from
similar sector of memory, (just add about 100-200 MB).

> Any comments on how stable this is and I could do this any better.

I would avoid hacks with LILO - you can specify the virtual address where
mmap occurs using shmat(...).

I consider your "ld" hack ingenious and will save your mail for future
reference. Please keep us informed.

Regards,
--
Tomek

--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to