Hi all,
I have this typical and very difficult to track problem.
I have a large memory block(64 MB) from which i allocate memory to various
threads using my own memory manager sort of module which is very simple one.
It just keeps track of the allcoated block and if its already allocated it
rejects the request to the calling thread. The threads passes starting
address and the size starting from 0 to 64MB -1.
My problem is one of my thread is overwriting the memory allocated to other
thread, which i come to know by compare error which my thread displays after
writing , reading and comparing the same block.
What i want to know is
-
is there any way that i can restrict the use of the shared memory by the
thread to which i have allocated the block through my memory manager. e.g.
by relating the thread handle or id to the area of memory block, and if the
other thread whose id/handle doesnt match to the one mapped to the thread
then it causes some type of exception or any notification. ( i dont know
whether this is possible or not, but I surely want to have any idea, if at
all we can do this.)
-
If yes, how?
Regards,
Manish
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
All threads in a process use the same memory map.
I you could put the block of memory at an arbitrary address
rather than 0, you’d be better off.
-DH
----- Original Message -----
From: “Sapariya Manish.j”
To: “NT Developers Interest List”
Sent: Sunday, April 01, 2001 12:27 PM
Subject: [ntdev] Shared memory and curroption by other thread.
> Hi all,
> I have this typical and very difficult to track problem.
>
> I have a large memory block(64 MB) from which i allocate memory to various
> threads using my own memory manager sort of module which is very simple one.
> It just keeps track of the allcoated block and if its already allocated it
> rejects the request to the calling thread. The threads passes starting
> address and the size starting from 0 to 64MB -1.
>
> My problem is one of my thread is overwriting the memory allocated to other
> thread, which i come to know by compare error which my thread displays after
> writing , reading and comparing the same block.
>
> What i want to know is
>
> 1. is there any way that i can restrict the use of the shared memory by the
> thread to which i have allocated the block through my memory manager. e.g.
> by relating the thread handle or id to the area of memory block, and if the
> other thread whose id/handle doesnt match to the one mapped to the thread
> then it causes some type of exception or any notification. ( i dont know
> whether this is possible or not, but I surely want to have any idea, if at
> all we can do this.)
>
> 2. If yes, how?
>
> Regards,
> Manish
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com