How to delete a attached shared memory.

This is a discussion on How to delete a attached shared memory. within the C Programming forums, part of the General Programming Boards category; i want to delete a shared memory which is in use, i mean it is still attached and some processes ...

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    134

    Exclamation How to delete a attached shared memory.

    i want to delete a shared memory which is in use, i mean it is still attached and some processes are using them. I am using to delete "ipcrm -shm shmid". But it is not able to delete the shared memory.

    In my code i am not deattaching shared memory after its use. coz i need it to be attached to maintain a counter.

    Can anybody give some input on this.
    S_ccess is waiting for u. Go Ahead, put u there.

  2. #2
    The C eater *munch*
    Join Date
    Oct 2006
    Posts
    101
    erh? code?

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    134
    I donot think so that there is any need of code..
    S_ccess is waiting for u. Go Ahead, put u there.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    > I am using to delete "ipcrm -shm shmid". But it is not able to delete the shared memory.
    Perhaps because it's returning a status of "still in use?"

    Why would you want to pull the rug out from under running processes?

    What are you expecting them to do after you've managed this trick - exit quietly in a controlled manner of fall over in a big heap of segfaults?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. delete a pointer with unallocated memory
    By lehe in forum C++ Programming
    Replies: 8
    Last Post: 04-21-2009, 02:12 AM
  2. Problems with shared memory shmdt() shmctl()
    By Jcarroll in forum C Programming
    Replies: 1
    Last Post: 03-17-2009, 11:48 PM
  3. Partly shared memory
    By DrSnuggles in forum C++ Programming
    Replies: 13
    Last Post: 01-21-2009, 03:35 AM
  4. Shared Memory - shmget questions
    By hendler in forum C Programming
    Replies: 1
    Last Post: 11-29-2005, 02:15 AM
  5. Managing shared memory lookups
    By clancyPC in forum Linux Programming
    Replies: 0
    Last Post: 10-08-2003, 05:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21