Thread: How to delete a attached shared memory.

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

    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
    136
    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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > 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.

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, 01:12 AM
  2. Problems with shared memory shmdt() shmctl()
    By Jcarroll in forum C Programming
    Replies: 1
    Last Post: 03-17-2009, 10: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, 04:44 AM