I have found that dmtcp (as of the 1.2.4 release, unable to build 1.2.5 due to 
the old OS I am on not having eventfd and signalfd) does not support 
semaphores, as it in does not re-create them if they've been removed. If it is 
in 1.2.5 please let me know and I'll work on how we can move up.

Example code:
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdio.h>

int main()
{
    int i, sid = 0;
    struct sembuf sops;

    sid = semget((key_t)333, 1, IPC_CREAT | 0666);
    if (sid < 0) {
        printf("Semaphore creation failure");
        return 1;
    }

    for (i = 0; i < 3; i++) {
        printf("Sleeping for 3 seconds. Do dmtcp_coordinator c\n");
        sleep(3);
    }

    printf("Accessing semaphore... ");
    sops.sem_num = 0;
    sops.sem_op = 0;
    sops.sem_flg = SEM_UNDO;
    if (semop(sid, &sops, 1) == -1) {
        printf("Failure\n");
    } else {
        printf("Success\n");
    }
    return 0;
}

// Create save point
dmtcp_checkpoint a.out

// Another window, when it gets to dmtcp_coordinator:
dmtcp_coordinator c

// This should pass
./dmtcp_restart.sh
ipcs (identify the semaphore)
ipcrm -s <semaphore id>

// This will fail
./dmtcp_restart.sh

Joshua Louie

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dmtcp-forum mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dmtcp-forum

Reply via email to