美文网首页
Unix进程间通信比较

Unix进程间通信比较

作者: 超哥__ | 来源:发表于2018-05-09 16:37 被阅读0次

    通信方式
    共享内存 (速度最快、需要进程处理同步)
    命名管道
    消息队列
    SOCKET
    RPC

    同步方式:
    文件锁
    信号量
    MONITOR

    共享内存

    System V IPC UNIX mmap POSIX IPC
    create memory area in operating system table ftok shmget open lseek write shm_open lseek write
    attach memory to virtual address space shmat mmap mmap
    detach memory from virtual address space shmdt munmap munmap
    remove memory area from operating system table shmctl close unlink close shm_unlink

    信号量

    POSIX named semaphores POSIX unnamed semaphores System V semaphores
    create semaphore sem_open sem_init semget
    initialize at creation time at creation time semctl
    P (…) sem_wait sem_timedwait sem_trywait
    sem_wait sem_timedwait sem_trywait semop
    V (…) sem_post sem_post semop
    read value sem_getvalue sem_getvalue semctl
    remove semaphore sem_close sem_unlink sem_destroy semctl

    boost/interprocess

    相关文章

      网友评论

          本文标题:Unix进程间通信比较

          本文链接:https://www.haomeiwen.com/subject/khtorftx.html