in Operating System
349 views
1 vote
1 vote
(i) What is Load/Store?
(ii) Explain fetch-and-set.

is there any relation between these two or any basis of comparision?
in Operating System
349 views

4 Comments

Load/Store is an architecture which can have 2 kind of instructions

load/store - Transfer of data within registers and memory

operation - ADD, INCR, etc

Few RISC architectures use this. Note that here for an operation, the operands has to be in registers whereas in register memory architecture used by CISC architectures can have their operands in the memory.

https://en.wikipedia.org/wiki/Load/store_architecture

There is no as such standard instruction called fetch-and-set. It is custom instruction used in a gate question in which

fetch-and-set x,y will

store value of x in y and set x to 1.  It is atomic instruction and hence both are done without any intervention in the execution.

1
1

https://gateoverflow.in/1839/gate2006-61 in this in one comment its mentioned that we cannot use load/store because it is atomic. can you please elobarate what he is trying to convey

0
0

In case you are talking about the comment by Tuhin Dutta,

He is saying the option "Instead of using fetch-and –set, a pair of normal load/store can be used " is wrong because load and store is not atomic.

Fetch and set instruction has multiple operations in it,

load value of x

store it in y

store #1 in x

If an instruction is not atomic, it might happen that due to preemption, only 1 or 2 get executed and the rest execute later. Hence, it's not a good option for fetch-and-set.

1
1
ohh thanks :)
0
0

Please log in or register to answer this question.

Related questions