Hello and welcome to the and programming language course in this session.
We want to talk about the others concurrency concept.
Only send China signature of Sergeant Sergeant Shannon, to which only you can send will be like below
when passed to a function as an argument.
Now let's go to the school for a grant to illustrate only sent China first create a function that accept
our government as a channel to which only you can send.
So we write foreign trusts set a variable like C-H.
By the time Chan Chan, an operator and eight.
And set a value through a channel, for example, search channel operator to.
Now go to main function and create a channel and pass it to a process function.
So define the variable like C-H calling equals and calling may function by the time channel end.
And, for example, the Triassic hand argument now calling process and set channels.
Argument Process said See us as arguments go to the next line and display M.A.S.H.
He
search the format they call, save the project and execute the program.
Go from dot.
Righteousness may not go.
Now we can see the output, we could send the value through a channel.
Now given to receive data from channel, so define a variable in process function and get channel value.
Value equals channel operator and search.
Reformat the code and see the project.
So we see then trying to receive data from a channel.
It has an arrow, solve the armistice line and execute again.
Now we can see the value of channel.
We could send the value to a channel and could not receive its value in a goal routine because the function
just accept arguement as a channel to which only send data, go to the slides and continue.
Only receive China Sea nature of this sorted channels from peace, you can only receive data will be
like below when passed to a function as an unit.
Now, let's go to this school curriculum to illustrate only receive China first year, the last quote
create a function that accept arguement as a channel to which only you can receive.
So we ride for process defining the value of a light switch channel operator channel by the time we.
Define a variable like value call equals channel operator, search and display the value FP
right
now, go to main function, create a channel and pass it to process function.
So define the variable like search call and equals calling make function channel by the time end and
the for second or unit, and send a value to create a channel search channel operator.
For example.
10 value now calling process and search channels argument to each go process and channel as argument.
Go to the next line and display.
Create a channel FP.
Can operate or see its reformat, they could save the project and execute the program.
Now we can see the output, we could receive the value to a channel.
But we want to send data to China, so write this code in process function.
See its channel operator.
50.
Even trying to send data to such a end will give it.
So, I mean, to design and execute programming again.
We could receive the value of a channel and could not send its value in a go routine because the function
just acts arguement as a channel to which only receive data, go to the slides and continue.
Shannon Poynter, this way of passing your channel would only make sense if you would want to modify
the channel.
This is very uncommon and not a profitable way to use signature off such a channel, which is pass as
a pointer.
Now let's go to your school program on to illustrate Channel Point to her first career the last quote.
Define a function that accept arguement as a channel pointer.
So you right from a process, set a variable like C age.
By the time a pointer changed, hands send the value to a channel pointer asterisk, see its channel
operator and send the value like to receive data from a channel pointer.
First, define the variable light is calling equals channel operator and asterisk C-H
and sits nil value to channel pointer asterisk search equals need now display the value of Channel FP.
Yes.
Now go to main function to create a chanin and positive process function.
Define the variable not see as column equals.
Make function by the time in and three a second argument calling process function and set arguments
as a channel pointer process.
And sit for some serious barrier business as arguments to eat this that H.A. saw you right, FP see
its reform at, they could save the projects and execute the program.
Go round the back.
Bush made that call.
Now we can see the output.
We could send and receive data to channel by Poynter in order not to prolong the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.