 Model 155 is about interlocked functions. We have discussed some interlocked functions previously and we have seen that through atomic operation we can increment or decrement our control variables. In that we have discussed functions interlocked increment or interlocked decrement and with the help of these two we perform atomic operations and increment our shared variables or decrement them. Apart from this, there are many other interlocked functions through which we can perform atomic operations on any shared variable. There are various kinds of atomic operations. They are used in various algorithms such as mutual exclusion or concurrency control and to enforce it we use those algorithms and in those algorithms we use these interlocked functions. With these interlocked functions you can perform an atomic operation on a certain variable. So we will look at the details of some other atomic operations. First of all, interlocked exchange. This is another atomic operation. Within this you have passed two parameters. A reference target and a value pass. The previous value of the target will return this function and it will be assigned to a new value. The value of the value will be assigned to it. For example, the value of value is 10 and the target value is 3. So wherever 3 is stored, you have passed its reference pass and you have placed 10 in the value. You have called it this way. When this function returns, this value will return 3 and the value of the value in the target will be 10. The value in the value will be assigned to the target and the previous value of the target will return this function. Similarly, a test set is used. When hardware oriented implementation is done of mutual exclusion or to enforce concurrency, there is a famous algorithm for it which is called a test set algorithm. There is also a test set operation which is available in this operation. Then there is another function. Interlocked exchange add. You pass this as an add-in. You pass the reference pass and you pass the increment. When this function returns, the previous value of the add-in of the add-in reference will return this value. That is, if there is a value of 3 on the reference of add-in, and you have kept the increment 5, then this function will return 3 and the new value of add-in will be 8. That is, the previous value of 3 and the increment you specified will be added to it. Similarly, the new value will return 8. Previously, we had seen that if we want to increment a value by 2 through these interlocked functions, then we cannot call the increment twice. Because if we call it twice, then that operation is not atomic. But with this function, we can also increment 2. We can specify the value of 2, 3 or whatever value you want. We can increment it and it will be operation atomic. Similarly, there is another function. Interlocked Compare Exchange. You have passed these three values. The reference of destination, the value of exchange and the value of a comparant. Now, there is an algorithm below. According to this algorithm, these three things will perform operation. But the way this algorithm is implemented, if you implement it in C or in any programming language, then it will not be atomic operation. The difference is that this operation is atomic. This is a single atomic operation during which no kind of context switching is possible. And this operation will be that the previous value of destination is stored in the temp and returns in the end. That is, the previous value of destination will be returned in the end. And it will be compared with the destination comparant. If the value of comparant and destination is the same, then the value of destination will be assigned to the new value. And the value of exchange will be the new value. For example, the value of destination is 2. The value of reference is 2. The value of comparant is 2. And the value of exchange is 5. The value of destination is 2. And the value of reference is 2. And the value of destination is 2. So, both are equal. The value of exchange is 5. So, this 5 will be assigned to the destination. The value of destination is 5. And the value of previous value will be returned. So, this is the function. There are different algorithms that can enforce mutual exclusion through this operation.