Различия между версиями 4 и 5
Версия 4 от 2020-03-22 12:34:27
Размер: 984
Редактор: FrBrGeorge
Комментарий:
Версия 5 от 2020-03-22 12:40:30
Размер: 1113
Редактор: FrBrGeorge
Комментарий:
Удаления помечены так. Добавления помечены так.
Строка 7: Строка 7:
  * You may also copy+paste and test other lecture examples:
   * queue creation
   * message receiving
   * queue unlinking

17. Inter-process communications: messages

Make 17_IPC2 directory and store code there.

Use lecture examples

  1. Wrirte a program sendmq.c that sends a message with priority 1 through the specified queue

    • ./sendmq /queue Message should send a message "Message" to queue "/queue" with priority 1

    • You may also copy+paste and test other lecture examples:
      • queue creation
      • message receiving
      • queue unlinking
  2. Write a «messaging server» mqserver.c that constantly waits on message queue and prints every message received.

    1. Create a queue
    2. Wait for the message and receive it
    3. If this message is not equal to string "QUIT" (i. e. 5 bytes: 'Q', 'U', 'I', 'T' and 0), then print it, and go to (2.)

    4. Stop receiving and unlink the queue if message is string "QUIT"

  3. Modify server to catch SIGINT. Call resulting program mqsignal.c

    • so when pressing Control+C the program should stop reading messages, unlink the queue and stop

    • check every function called for possible errors

H/W

  • Finish all tasks

HSE/ProgrammingOS/Lab_17_IPC2 (последним исправлял пользователь FrBrGeorge 2020-03-22 12:40:30)