Kconfig 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. menu "Interprocess Communication (IPC)"
  2. config RT_USING_POSIX_PIPE
  3. bool "Enable pipe and FIFO"
  4. select RT_USING_POSIX_FS
  5. select RT_USING_POSIX_DEVIO
  6. select RT_USING_POSIX_POLL
  7. select RT_USING_RESOURCE_ID
  8. default n
  9. help
  10. Enable POSIX pipes and FIFOs for inter-process communication.
  11. Provides:
  12. - Anonymous pipes: pipe(pipefd)
  13. - Named pipes (FIFOs): mkfifo(path, mode)
  14. - Unidirectional byte streams
  15. - Blocking and non-blocking I/O
  16. Features:
  17. - Simple producer-consumer pattern
  18. - Works with select/poll for multiplexing
  19. - File descriptor based (can use read/write)
  20. Use cases:
  21. - Parent-child process communication
  22. - Shell command pipelines
  23. - Simple message passing
  24. - Event notification
  25. Buffer size: RT_USING_POSIX_PIPE_SIZE
  26. Enable for POSIX pipe/FIFO support.
  27. Essential for shell pipeline and process IPC.
  28. config RT_USING_POSIX_PIPE_SIZE
  29. int "Set pipe buffer size"
  30. depends on RT_USING_POSIX_PIPE
  31. default 512
  32. help
  33. Size of pipe buffer in bytes.
  34. Default: 512 bytes
  35. Trade-offs:
  36. Larger buffer:
  37. + More data can be buffered
  38. + Better performance for burst writes
  39. - More memory per pipe
  40. Smaller buffer:
  41. + Less memory usage
  42. - More frequent blocking on writes
  43. Typical values: 512-4096 bytes
  44. Adjust based on typical message sizes and memory constraints.
  45. # We have't implement of 'systemv ipc', so hide it firstly.
  46. #
  47. # config RT_USING_POSIX_IPC_SYSTEM_V
  48. # bool "Enable System V IPC"
  49. # default n
  50. # help
  51. # System V supplies an alternative form of interprocess communication consisting of thress
  52. # features: shared memory, message, and semaphores.
  53. config RT_USING_POSIX_MESSAGE_QUEUE
  54. bool "Enable posix message queue <mqueue.h>"
  55. select RT_USING_POSIX_CLOCK
  56. select RT_USING_MESSAGEQUEUE_PRIORITY
  57. select RT_USING_DFS_MQUEUE
  58. default n
  59. help
  60. Enable POSIX message queues for IPC.
  61. Provides POSIX message queue APIs:
  62. - mq_open(): Open/create message queue
  63. - mq_send()/mq_receive(): Send/receive messages
  64. - mq_timedsend()/mq_timedreceive(): With timeout
  65. - mq_notify(): Async notification
  66. - mq_getattr()/mq_setattr(): Queue attributes
  67. Features:
  68. - Priority-based message delivery
  69. - Named queues (visible in /dev/mqueue)
  70. - Blocking and non-blocking modes
  71. - Timeout support
  72. - Asynchronous notification
  73. vs. Pipes:
  74. + Message boundaries preserved
  75. + Priority-based delivery
  76. + Can be used with select/poll
  77. - More overhead per message
  78. Use cases:
  79. - Process communication with priorities
  80. - Event notification systems
  81. - Service request queues
  82. - RT-Smart IPC
  83. Requires DFS with MQUEUE support.
  84. Enable for POSIX message queue IPC.
  85. config RT_USING_POSIX_MESSAGE_SEMAPHORE
  86. bool "Enable posix semaphore <semaphore.h>"
  87. select RT_USING_POSIX_CLOCK
  88. default n
  89. help
  90. Enable POSIX named and unnamed semaphores.
  91. Provides semaphore APIs:
  92. - sem_init()/sem_destroy(): Unnamed semaphores
  93. - sem_open()/sem_close()/sem_unlink(): Named semaphores
  94. - sem_wait()/sem_trywait()/sem_timedwait(): Acquire
  95. - sem_post(): Release
  96. - sem_getvalue(): Get current value
  97. Types:
  98. - Unnamed (memory-based): For thread synchronization
  99. - Named (file-based): For process synchronization
  100. Features:
  101. - Counting semaphore (value > 1)
  102. - Binary semaphore (value = 0 or 1)
  103. - Timeout support
  104. - Non-blocking try operation
  105. Use cases:
  106. - Thread/process synchronization
  107. - Resource counting
  108. - Producer-consumer patterns
  109. - Mutual exclusion
  110. vs. Mutex:
  111. + Can be used for signaling (sem_post from any thread)
  112. + Counting capability
  113. - No ownership tracking
  114. Enable for POSIX semaphore support.
  115. Essential for POSIX synchronization.
  116. comment "Socket is in the 'Network' category"
  117. endmenu