Trying to understand locks
mwalimu
Posts: 44
I've been trying to get a a grasp on the concepts of LOCKS. The documentation is either deceptively simple or it's vague, I can't decide. I just need a someone who gets them to double check my understanding.
a) LOCKs don't actually prevent a resource from being used. They are just flags that a cog can set.
b) The actual area that actual resource that a lock protects is arbitrary, that is it is up to the programmer to decide.
So my understanding is that a lock is something like a bathroom door that can't be latched. The agreement is that if the door is closed it's in use. That doesn't stop someone from barging in, it's just a prearranged signal.
Is that about right?
a) LOCKs don't actually prevent a resource from being used. They are just flags that a cog can set.
b) The actual area that actual resource that a lock protects is arbitrary, that is it is up to the programmer to decide.
So my understanding is that a lock is something like a bathroom door that can't be latched. The agreement is that if the door is closed it's in use. That doesn't stop someone from barging in, it's just a prearranged signal.
Is that about right?
Comments
-Phil
In most cases you won't need locks. I have never used them, nor have I seen code using them. So, if you are new to the prop, ignore them for now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm