In PL/1, in addition to regular pointer variables, there were also "area"
variables and "offset" variables. The idea being that it didn't matter where
an area started, because all the offset variables were relative to the start
address.
You could do the same thing in C, declaring e.g.
unsigned ch
If you are running older versions of OpenSolaris/Solaris which do not include
NUMA observability tools you can get the latest version 0.1.6 from
http://www.opensolaris.org/os/community/performance/numa/observability/tools/tools_download/
It in sync with what is in ONNV. You still need to have O
Ganesh:
> Next when the client processes comes up, they attach to all these shms
> created by server process. When the client process calls "shmat" on
> the first 3 memory segments, shmat returns the same address which it
> returned to server process (these addresses are stored in 1st shm).
> But
That helps. I'll consider before finally deciding what to use.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 04 April 2007 18:04
To: Borse, Ganesh
Cc: 'perf-discuss@opensolaris.org'
Subject: Re: [perf-discuss] Request for guidance on shmat() call attaching at
It depends on what you're trying to accomplish. I see 2 advantages of
using mmap:
1. the data is persistent. If you want the data persistent across boot,
mmap-ed data is in a file.
When you start your processes after a reboot, with mmap the data is
already there. You just mmap the file(s) a
Thanks for time.
I did not think of using mmap. (Rather I'm bit unsure about what to use when -
so I statyed with shmat).
Yes, I when I gave address instead of (void*)0 with shmat, it attached to same
address.
What would you prefer? - mmap with address or shmat with adress? - or both are
same
Hi Ganesh,
I have done the same kind of thing you are trying to do with
shmget/shmat, but
I used mmap. With mmap, I needed to specify the address (first arg to
mmap(2)) with
the MAP_FIXED flag. Have you tried specifying an address instead of the
"(void*)0"?
(I admit, using SHM_SHARE_MMU flag
No, it is not the address (the 2nd param) passed to shmat calls. I'm passing
"(void*)0".
It is the address returned by shmat, after attaching the segment.
My code is as below:-
int id = shmget(key,size,(0777 | IPC_CREAT | IPC_EXCL));
if(errno == EEXIST){
id = shmget(key,size,(0777 | IPC_CREAT))
Hi Genesh,
Are you specifying an address in your shmat calls? Can you post code
segments doing
shmget/shmat?
max
Borse, Ganesh wrote:
Hi,
I am facing a problem of shared memory segment getting attached at
different address, when the processes using it go down and attach
count goes to zer