edited by
4,369 views
21 votes
21 votes

A certain processor provides a 'test and set' instruction that is used as follows:

  TSET register, flag

This instruction atomically copies flag to register and sets flag to $1$. Give pseudo-code for implementing the entry and exit code to a critical region using this instruction.

edited by

6 Answers

0 votes
0 votes

I think this is solution...please comment if something is wrong

Related questions

29 votes
29 votes
4 answers
3
Kathleen asked Sep 23, 2014
13,188 views
Booth's coding in $8$ bits for the decimal number $-57$ is:$0-100+1000$$0-100+100-1$$0-1+100-10+1$$00-10+100-1$
35 votes
35 votes
4 answers
4
Keith Kr asked Sep 12, 2014
14,403 views
The minimum number of record movements required to merge five files A (with $10$ records), B (with $20$ records), C (with $15$ records), D (with $5$ records) and E (with ...