atomic operation

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
Badhan
Posts: 9
Joined: Mon Sep 05, 2011 9:15 am

atomic operation

Post by Badhan »

Hi guys,
i have a confusion with automic instruction. In the following code , i have a TSL instruction, which works automic. Thats fine. But, my question is, can i conside that the whole tsl_function works automic. (like , these 4 lines will be executed without being interrupted.)

TSL_enter_region:
tsl reg, lock
cmp reg, #0
jne TSL_enter_region
ret


Thanks for your help.
Badhan
Posts: 9
Joined: Mon Sep 05, 2011 9:15 am

Re: atomic operation

Post by Badhan »

i think , NO. This might be a implementation of Spin-lock. When a Theard is in busy-wait. And , An timer interrupt can occur, which takes this Thread away from this looping(spin-lock).

Am i right?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: atomic operation

Post by gerryg400 »

Firstly, please take some care with your spelling and capitalisation.
But, my question is, can i conside that the whole tsl_function works automic. (like , these 4 lines will be executed without being interrupted.)
No the entire function is not atomic. It looks like it contains an atomic instruction.
This might be a implementation of Spin-lock. When a Theard is in busy-wait. And , An timer interrupt can occur, which takes this Thread away from this looping(spin-lock).
You are probably correct that it is a spinlock implementation.
Am i right?
It depends. What is your real question ?
If a trainstation is where trains stop, what is a workstation ?
Badhan
Posts: 9
Joined: Mon Sep 05, 2011 9:15 am

Re: atomic operation

Post by Badhan »

Thank you very much . I have got my answer.
Post Reply