Re: Linked List in Shared Memory
- From: "Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx>
- Date: Tue, 6 Oct 2009 09:20:03 -0600
Although it requires a bit more work, it is still possible to implement a linked list and insert and delete items using an array.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"C Programmer , MFC" <sathishsster@xxxxxxxxx> wrote in message news:5c3cafb2-1a21-4e80-9b5a-4846d65ab058@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Oct 5, 5:34 pm, Goran <goran.pu...@xxxxxxxxx> wrote:On Oct 5, 1:31 pm, "C Programmer , MFC" <sathishss...@xxxxxxxxx>
wrote:
> Hi,
> I am Satheesh asking a question
> how can i implement a LinkedList (singly/doubly) in a Shared Memory in
> C++.
> Bcse In interprocess communication 2/more process can share the add/
> delete/update the values in the object in the Linkedlist via
> pointer's.how can i achieve this.
> Plz Give me an example.
> Regards
> Satheesh.S
Simple data structure that will do that is index-based (not pointer-
based) linked list, e.g:
template <typename YOUR_DATA>
struct Example
{
Example() :Prev(end), next(end) {}
YOUR_DATA Data;
enum { end = -1 };
int Prev;
int Next;};
Example example[ITEM_COUNT];
(I am too lazy to write operations down, but you can probably find
that on the internet. In fact, I'd be surprised that there isn't even
a C++ implementation of the above somewhere already.)
Why do you need indexes? Because pointers are specific to your
process's address space, and are different from one process to
another, hence their inapplicability in an IPC scenario.
That said... Unless this is not for a homework, I would strongly
suggest COM for any inter-process communication under Windows. COM may
seem to be from another world, but (bar learning curve), for anything
"real", it's leaps and bounds better than lower level system
primitives (shared memory, pipes, mailslots etc).
Goran.
Hi Goran ,
Thank you very much for your reply.
And i am using winxp os, unfortunately i forget this to say.
in my research i got some idea is that ,it is not satisfied with
indexes bcse we need to delete the node add new node etc etc , in the
case of array using in shared memory is is not proper well i am
finding to get a new technique to do some hot work as to implement the
same linkedlist to avail the pointer's through shared memory , i am
not sure to get this but trying...
regards
Sathish.S
.
- Follow-Ups:
- Re: Linked List in Shared Memory
- From: Joseph M . Newcomer
- Re: Linked List in Shared Memory
- References:
- Linked List in Shared Memory
- From: C Programmer , MFC
- Re: Linked List in Shared Memory
- From: Goran
- Re: Linked List in Shared Memory
- From: C Programmer , MFC
- Linked List in Shared Memory
- Prev by Date: Re: Use Dialog instead Window in MFC Problem !
- Next by Date: Re: How can I use ADO to get a Memo field as a Chunk when it contains binary data?
- Previous by thread: Re: Linked List in Shared Memory
- Next by thread: Re: Linked List in Shared Memory
- Index(es):
Relevant Pages
|