synchronization - When is useful to use SpinLock sync primitive in .NET? -


i learning basics of parallel programming in .net , wondering why need use spinlock sync primitive. read using of mechanism avoids rescheduling when waiting sync primitive release (and worth when waiting time short), there way measure 'effectivity'? don't want make decision whether use spinlock or not because said 'you shouldn't in cases'.

by using spinlock telling thread busy waiting - thread not going in blocked state, spinning wastes cpu cycles , prevents cpu doing more useful work. if know in advance run on multi core machine( spin lock on single core machine not idea) , know going spin relative short time( moving thread block state cpu intensive) might ok


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -