YouTube2Text

pipes 2 — Transcript

by juancarlosjromer · 708 words · 104 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Good morning. Let's start with the
  2. 0:03second part of the introduction to pipe
  3. 0:05programming. Now let's see the example
  4. 0:11problem. Thank you very much. The
  5. 0:13example problem is a pipe exercise that
  6. 0:17involves creating a chat between
  7. 0:19related processes. The objectives of
  8. 0:23this exercise are to learn the basic
  9. 0:25features of concurrent programming, the
  10. 0:28mechanisms used by the operating system
  11. 0:30to create processes, and the use of the
  12. 0:33pipe resource for communication between
  13. 0:35related processes. The exercise
  14. 0:38approach consists of creating a
  15. 0:40structure of related processes with
  16. 0:43five processes. A parent process will
  17. 0:46create two child processes, and each
  18. 0:48child process will create a grandchild
  19. 0:50process. Process creation is done using
  20. 0:53the for system call. The chat will be
  21. 0:56carried out between the child processes
  22. 0:58, which will be the writers, and each
  23. 1:00grandchild process will be the reader
  24. 1:02of its corresponding writer. It was
  25. 1:05decided to use two pipes as a
  26. 1:06communication resource between
  27. 1:08processes in order to make programming
  28. 1:10simpler and focus the problem on the
  29. 1:13concept. It is recommended that the
  30. 1:15student complete the same exercise
  31. 1:17using a single pipe. Here is the
  32. 1:20diagram of the approach. We see a
  33. 1:22parent process that creates a child one
  34. 1:25and a child two with two for. Then
  35. 1:29child one creates grandchild one with a
  36. 1:31fork. Child two creates grandchild two
  37. 1:33with a fork. Then we see the pipes that
  38. 1:37are going to be used for interprocess
  39. 1:39communication in the chat. Child one is
  40. 1:43going to write to pipe 2, child two is
  41. 1:46going to write to pipe 1. Grandchild
  42. 1:48one is going to read to child one from
  43. 1:51pipe 1. And grandchild two is going to
  44. 1:54read from pipe 2 to child two. Child
  45. 1:58two, uh, sorry, child one and child two
  46. 2:00are going to receive keyboard input,
  47. 2:03which is what users are going to type
  48. 2:05for the chat, and the grandchildren are
  49. 2:08going to display on the screen what
  50. 2:10they read from the pipes. Okay, let's
  51. 2:13see the description of the approach.
  52. 2:15What should the parent do? The parent
  53. 2:18should create the two pipe resources,
  54. 2:20pipe 1 and pipe 2. It begins the
  55. 2:23creation of the process structure. It
  56. 2:26specifies that it will not be a writer
  57. 2:29or reader of any of the pipes and waits
  58. 2:31for child one and child two to finish.
  59. 2:34And then it finishes. creates the pipes
  60. 2:40with the pipe call passing it the
  61. 2:43vectors pipe 1 and p 2 as arguments.
  62. 2:48Okay, now we see the creation of the
  63. 2:50process structure. The red arrow marks
  64. 2:54the fork that will create child one.
  65. 2:58The green arrow marks the fork where
  66. 3:00child two will be created. What is
  67. 3:03highlighted in yellow is the most
  68. 3:05important part of the parent, which is
  69. 3:08closing all the descriptors of the read
  70. 3:11and write pipes. The blue part is where
  71. 3:14child two creates grandchild two and
  72. 3:17the pink part is where child one
  73. 3:20creates grandchild one. Another part to
  74. 3:23highlight about the parent process is
  75. 3:26that it has to wait for the termination
  76. 3:28of child one and child two and then it
  77. 3:31ends. There we have the code that does
  78. 3:34what we are proposing. I choose one. It
  79. 3:38will only be a writer of pipe 2. The
  80. 3:40message it writes to pipe 2 is obtained
  81. 3:43from standard input. Reading from
  82. 3:47standard input ends when it gets stream
  83. 3:51chau and waits for grandchild 1 to
  84. 3:54finish. Child 2 will only be a writer
  85. 3:58to pipe 1. The message it writes to
  86. 4:00pipe 1 is obtained from standard input.
  87. 4:04Reading from standard input ends when
  88. 4:07it gets stream chu and waits for
  89. 4:09grandchild 2 to finish. Grandchild 1
  90. 4:13will only be a reader of pipe 1.
  91. 4:15Reading from the pipe writes to
  92. 4:17standard output and ends when it reads
  93. 4:20stream ch from the pipe. Grandchild 2
  94. 4:24will only be a reader of pipe 2.
  95. 4:26Reading from the pipe writes to
  96. 4:28standard output and ends when it reads
  97. 4:30stream ch from the pipe. Well, we are
  98. 4:34going to implement this example in an
  99. 4:38operational environment, in a Linus
  100. 4:41Deviant operating environment using the
  101. 4:44C language. Well, this concludes the
  102. 4:47second part of the introduction to Pipe
  103. 4:49programming. Thank you very much and we
  104. 4:52look forward to the third part. M.

About this transcript

This page contains the full transcript of pipes 2 by juancarlosjromer, generated from the public captions YouTube serves with the video. The transcript has 708 words across 104 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.