项目作者: raphaelauv

项目描述 :
Atomic Concurrent Queue (Circular-buffer) | UNIX IPC
高级语言: C
项目地址: git://github.com/raphaelauv/CONCURRENT-QUEUE-IPC-UNIX.git
创建时间: 2017-06-09T12:21:58Z
项目社区:https://github.com/raphaelauv/CONCURRENT-QUEUE-IPC-UNIX

开源协议:

下载


IPC -> INTER-PROCESSUS COMMUNICATIONS

all details and benchmark in the PDF file : Rapport Projet System M1.pdf

a popular exemple of POSIX IPC is -> mqueue.h

ATOMIC CIRCULAR-BUFFER Message queue IMPLEMENTATIONS (UNIX)

  • Custom Atomic Guaranteed limit
  • Thread Safe ( Multiprocessing or Multithreading)
  • Blocking read,write,write_eof
  • Non Blocking read,write,write_eof
  • Vectored read,write

  • Compliant operations (try to read or write as far as ask by user while respecting atomic limit and blocking mode)

  • Message queue can be anonymous or maped in a file
  • Code Correctness (All systemCall and Mutex Operations return values are tested)

IMPLEMENTATIONS

1 ) conduct.c is not concurrent and not lock-free

  1. - The define MODE_MEMCPY at TRUE use the memcpy function from standard C library else it don't

2) concurrentconduct.c is concurrent and not lock-free (Writer and Reader can use at the same time the Circular-Buffer)

  1. - It use ATOMIC OPERATIONS
  2. - There is 2 implementation possible :
  3. MPMC -> multiple producer multiple consumer solutions
  4. SPSC -> single producer single consumer solutions

COMPILATION

  1. make
  2. without argument , compile the test FILES with the not concurrent implementation of conducts
  3. make conc
  4. with argument "conc" , compile the test FILES with the concurrent implementation of conducts

TEST FILES

- julia

  1. #define MODE_FILE 1 named file mode
  2. #define MODE_BLOCK 1 mode blocking

- test_3thread_depedency launch 3 type of threads with 2 shared conduct

  1. threads ORDER write in Conduct 1 || threads WORKER read in Conduct 1 and after write in conduct 2 || threads RESULT read Conduct 2
  2. #define QSIZE 100 the number of oder per threads
  3. #define MODE_COND 1 mode conduct is activate , others are not
  4. #define MODE_PIPE 0
  5. #define MODE_SOCKET 0

- test_vectored_IO

- test_simple

POSSIBLE IMPROVEMENT

  1. - Robust Mutex
  2. - Signals corectness

strace -c -f ./julia
time ./julia

Benchmark

more details in the PDF file

alt text