pipes 2 — Transcript
Full transcript
- 0:00Good morning. Let's start with the
- 0:03second part of the introduction to pipe
- 0:05programming. Now let's see the example
- 0:11problem. Thank you very much. The
- 0:13example problem is a pipe exercise that
- 0:17involves creating a chat between
- 0:19related processes. The objectives of
- 0:23this exercise are to learn the basic
- 0:25features of concurrent programming, the
- 0:28mechanisms used by the operating system
- 0:30to create processes, and the use of the
- 0:33pipe resource for communication between
- 0:35related processes. The exercise
- 0:38approach consists of creating a
- 0:40structure of related processes with
- 0:43five processes. A parent process will
- 0:46create two child processes, and each
- 0:48child process will create a grandchild
- 0:50process. Process creation is done using
- 0:53the for system call. The chat will be
- 0:56carried out between the child processes
- 0:58, which will be the writers, and each
- 1:00grandchild process will be the reader
- 1:02of its corresponding writer. It was
- 1:05decided to use two pipes as a
- 1:06communication resource between
- 1:08processes in order to make programming
- 1:10simpler and focus the problem on the
- 1:13concept. It is recommended that the
- 1:15student complete the same exercise
- 1:17using a single pipe. Here is the
- 1:20diagram of the approach. We see a
- 1:22parent process that creates a child one
- 1:25and a child two with two for. Then
- 1:29child one creates grandchild one with a
- 1:31fork. Child two creates grandchild two
- 1:33with a fork. Then we see the pipes that
- 1:37are going to be used for interprocess
- 1:39communication in the chat. Child one is
- 1:43going to write to pipe 2, child two is
- 1:46going to write to pipe 1. Grandchild
- 1:48one is going to read to child one from
- 1:51pipe 1. And grandchild two is going to
- 1:54read from pipe 2 to child two. Child
- 1:58two, uh, sorry, child one and child two
- 2:00are going to receive keyboard input,
- 2:03which is what users are going to type
- 2:05for the chat, and the grandchildren are
- 2:08going to display on the screen what
- 2:10they read from the pipes. Okay, let's
- 2:13see the description of the approach.
- 2:15What should the parent do? The parent
- 2:18should create the two pipe resources,
- 2:20pipe 1 and pipe 2. It begins the
- 2:23creation of the process structure. It
- 2:26specifies that it will not be a writer
- 2:29or reader of any of the pipes and waits
- 2:31for child one and child two to finish.
- 2:34And then it finishes. creates the pipes
- 2:40with the pipe call passing it the
- 2:43vectors pipe 1 and p 2 as arguments.
- 2:48Okay, now we see the creation of the
- 2:50process structure. The red arrow marks
- 2:54the fork that will create child one.
- 2:58The green arrow marks the fork where
- 3:00child two will be created. What is
- 3:03highlighted in yellow is the most
- 3:05important part of the parent, which is
- 3:08closing all the descriptors of the read
- 3:11and write pipes. The blue part is where
- 3:14child two creates grandchild two and
- 3:17the pink part is where child one
- 3:20creates grandchild one. Another part to
- 3:23highlight about the parent process is
- 3:26that it has to wait for the termination
- 3:28of child one and child two and then it
- 3:31ends. There we have the code that does
- 3:34what we are proposing. I choose one. It
- 3:38will only be a writer of pipe 2. The
- 3:40message it writes to pipe 2 is obtained
- 3:43from standard input. Reading from
- 3:47standard input ends when it gets stream
- 3:51chau and waits for grandchild 1 to
- 3:54finish. Child 2 will only be a writer
- 3:58to pipe 1. The message it writes to
- 4:00pipe 1 is obtained from standard input.
- 4:04Reading from standard input ends when
- 4:07it gets stream chu and waits for
- 4:09grandchild 2 to finish. Grandchild 1
- 4:13will only be a reader of pipe 1.
- 4:15Reading from the pipe writes to
- 4:17standard output and ends when it reads
- 4:20stream ch from the pipe. Grandchild 2
- 4:24will only be a reader of pipe 2.
- 4:26Reading from the pipe writes to
- 4:28standard output and ends when it reads
- 4:30stream ch from the pipe. Well, we are
- 4:34going to implement this example in an
- 4:38operational environment, in a Linus
- 4:41Deviant operating environment using the
- 4:44C language. Well, this concludes the
- 4:47second part of the introduction to Pipe
- 4:49programming. Thank you very much and we
- 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.