WEBVTT

00:05.870 --> 00:12.020
So guys, now let us try to understand the concept of transfer of data and transfer of computation and

00:12.020 --> 00:13.730
what is the difference between them.

00:14.000 --> 00:20.060
So in case of transfer of data, let us suppose that we have two entities the entity one and the entity

00:20.060 --> 00:20.630
two.

00:20.660 --> 00:23.900
The entity one and entity could be the two threads.

00:23.900 --> 00:25.700
There could be the two process.

00:25.700 --> 00:29.540
There could be the two process running on the same machine or different machine.

00:29.540 --> 00:30.320
Right.

00:30.410 --> 00:36.740
Entity one and entity two are just two bodies which wants to communicate with each other.

00:36.740 --> 00:37.400
Right?

00:38.570 --> 00:45.560
Now let us suppose that entity one owns two integers, let us say an integer A and integer B, whereas

00:45.590 --> 00:48.080
Entity two owns the computation part.

00:48.110 --> 00:51.950
That is entity two knows how to multiply two numbers.

00:51.980 --> 00:52.640
Right.

00:53.930 --> 00:59.870
Let us assume that entity one does not know how to multiply two numbers and it relies on the entity

00:59.870 --> 01:01.640
two to compute two numbers.

01:01.640 --> 01:02.300
Right.

01:02.540 --> 01:09.590
Also, let us assume that entity two has a local storage in which it can store the result which it obtains

01:09.590 --> 01:11.410
after multiplying the two numbers.

01:11.420 --> 01:11.990
Right.

01:12.000 --> 01:15.950
So C is the memory location, which is a local storage of the entity.

01:15.950 --> 01:22.430
Two So on whichever machine the entity two is running C is a local storage of that machine.

01:22.610 --> 01:28.130
Now let us suppose that we need to compute the multiplication of two numbers A and B, right?

01:28.130 --> 01:34.160
So it is quite obvious that entity one has to send these two numbers to somebody who can multiply,

01:34.160 --> 01:34.850
right?

01:34.850 --> 01:40.760
So it means that there should be a transfer of data from entity one to entity two.

01:40.790 --> 01:47.450
Once the entity two receives the values of A and B, it can do the computation on A and B and whatever

01:47.450 --> 01:53.280
final results it obtains, it can store this result to its local storage right.

01:53.850 --> 02:00.930
So you can see there is a transfer of data from entity one to entity two, and the computation is stationary,

02:00.930 --> 02:03.900
which is present on entity two side only.

02:03.900 --> 02:04.650
Right?

02:05.580 --> 02:08.960
Now let us understand what is transfer of computation.

02:08.970 --> 02:13.440
In fact, the transfer of computation is exactly opposite to the transfer of data.

02:13.440 --> 02:20.370
So in this case also we have two entities and one entity owns the data and the other entity owns the

02:20.370 --> 02:21.330
computation.

02:21.910 --> 02:24.220
Now the end goal is same.

02:24.220 --> 02:30.370
That is, the multiplication of these two numbers need to be stored in the local storage of the entity

02:30.370 --> 02:31.350
Two's memory.

02:31.360 --> 02:32.020
Right.

02:32.590 --> 02:40.270
But in this case, instead of sending the values of A and B from an entity, one to entity to entity

02:40.270 --> 02:45.820
two itself chooses to send the computation to the entity one.

02:45.820 --> 02:46.500
Right?

02:46.510 --> 02:51.370
That is, it is the function which is being sent from entity two to entity one.

02:51.370 --> 02:55.000
And once the entity one receives this computation logic.

02:56.360 --> 03:03.170
It can feed its data members as an argument to this computation logic and whatever result is produced,

03:03.170 --> 03:08.150
this result can be stored in the local storage, which is owned by the entity too.

03:08.330 --> 03:12.710
Now you must be saying that there is a transfer of data, right?

03:12.740 --> 03:17.270
The result Si is being sent from entity one to entity two.

03:17.270 --> 03:25.100
So no, actually there is no transfer of data because here we have a constraint that entity one and

03:25.100 --> 03:30.410
entity two must reside in the same virtual address space, right?

03:30.440 --> 03:37.310
That is entity one must have an access to the local storage of the entity two and entity two must have

03:37.310 --> 03:39.830
an access to the local storage of the entity.

03:39.830 --> 03:41.240
One Right.

03:41.600 --> 03:47.690
So transfer of computation is feasible only when entity one and two are in the same virtual address

03:47.690 --> 03:48.320
space.

03:48.320 --> 03:54.530
And now we already know what are the two entities who lives in the same virtual address space that is

03:54.530 --> 03:56.130
threads right?

03:57.000 --> 04:03.300
So it simply means that transfer of computation is possible only when entity one and entity two are

04:03.300 --> 04:05.370
the two threads of the same process.

04:05.610 --> 04:06.320
Right?

04:06.330 --> 04:10.290
They live in the same virtual address space of a process, right.

04:10.620 --> 04:16.710
So it simply means that the result Si is being stored by entity one into the memory location.

04:16.740 --> 04:21.510
Si which is owned by entity two without any transfer of data.

04:21.540 --> 04:27.120
The address of this Si memory location is accessible to the entity one also right?

04:27.120 --> 04:31.050
So it can directly write the result into this memory location.

04:31.740 --> 04:37.230
So in a nutshell, if you were to summarize what is transfer of computation, Transfer of computation

04:37.230 --> 04:41.880
is nothing, but it is just a function call through a pointer, right?

04:42.030 --> 04:47.550
So many of you must already be knowing that what is a function pointer and how does this work?

04:47.580 --> 04:50.040
I have just given you a broader perspective.

04:50.070 --> 04:54.660
That function pointer is actually an example of transfer of computation.

04:55.230 --> 05:00.540
Transfer of computation can also be implemented in different ways, not necessarily through function

05:00.540 --> 05:04.470
pointers, but that is the topic of some other course I guess.

05:05.080 --> 05:11.080
So now in the next lecture video, we will go through the example which demonstrates the transfer of

05:11.080 --> 05:12.010
computation.
