Spinlocks and Read-Write Locks Most parallel programming in some way will involve the use of locking at the lowest levels. Locks are primitives that provide mutual exclusion that allow data structures to remain in consistent states. Without locking, multiple threads of execution may simultaneously modify a data structure. Without a carefully thought out (and usually complex) lock-free algorithm, t
åã®ã¨ã³ããªã§æ¬¡æC++æ¨æº(é称C++0x)ã«atomicåã¨ã¡ã¢ãªããªã¢ãå°å ¥ãããã¨ãã話ããã¾ãããä»åã¯ãã®C++ã§ã®å®è£ ã«ã¤ãã¦ãããå°ãæ·±ã追ãããã¦ã¿ã¾ãã ã¹ã©ã¤ãè³æã§ã¯ãatomicæä½ ï¼ acquire/releaseããªã¢ããåºæ¬ã§ããã¨æ¸ãã¾ããããå®éã«æ¬¡æC++ã«å°å ¥ãããäºå®ã®atomic APIã¯ãããå°ãè¤éãªä»æ§ã«ãªã£ã¦ãã¾ããä¸çªã®éãã¯ãã¡ã¢ãªããªã¢ã®ç¨®é¡ãå¢ãã¦ãããã¨ã§ãã 次æC++æ¨æºã®ç¾å¨ã®ãã©ããã§ã¯ãã¡ã¢ãªããªã¢ã®ç¨®é¡ã表ãenumåã®å®ç¾©ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã namespace std { typedef enum memory_order { memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, m
ãã¾ã @kumagi boost.atomicã¯64bitå¹ ã®æã«ä¸ä½16bitã«ã«ã¦ã³ã¿ãåãè¾¼ãã£ã¦ããã®ãè³å¦ããã¿ããã ããã©ãå対æè¦ã®äººã¯ãã®bitæ°ã¾ã§å¿ è¦ãªã¡ã¢ãªã使ããã§ããããã48ãããããã°262ãã©ãã¤ãã¾ã§è¡ããã¯ãâ¦ã 2011-11-04 22:48:06 ãã¾ã @yamasa @kumagi ç§ã¯ã«ã¦ã³ã¿ã16bitã§ããç¹ãæ°ã«ãªãã¾ããããã¨ãã°3000ã¯ããã¯ã«1ã®å²åã§ã«ã¦ã³ãã¢ãããããã¨ä»®å®ããã¨ã16bitã«ã¦ã³ã¿ãä¸å¨ããã®ã«196Mãµã¤ã¯ã«ã2GHzã®CPUã ã¨100mså¼±ã§ãã 2011-11-05 00:13:25
HTMã®ç¬¬ä¸äººè ã«ãã¦ãobstruction-freeãwait-freeãªã©ã®å³å¯ãªå®ç¾©ããCASå½ä»¤ã®æ°å¦çãªæ義ã証æããThe Art of Multiprocessor Programmingã®èè ã§ãããã¯ããªã¼ã§ãSTMã§ãå «é¢å èã®æ´»èºããã¦ããMaurice Herlihyå çãé£åãã¦ããæè¿ã®è«æãæµãèªã¿ã Aleksandar Dragojevic, Maurice Herlihy, Yossi Lev, Mark Moir: On the power of hardware transactional memory to simplify memory management. PODC 2011: 99-108 ããã©ã³ã¶ã¯ã·ã§ãã«ã¡ã¢ãªã®ãã¯ã¼ã§ã¡ã¢ãªç®¡çãç°¡ç¥åãããã¨ããæãã GCã使ããªãç°å¢ä¸ã«ããã¦ã¡ã¢ãªç®¡çã¯é¬¼éã«ãªã£ã¦ã¦ããã®ããã§C++ã®ã
ãã¾ã @kumagi ããã°æ¸ãã ãuserspace RCU(QSBR)ã®ä½¿ãæ¹ã¨è§£èª¬ã http://t.co/mvjPoU6M51 å®å ¨ã«ããã¯ããªã¼ããããã®å±æçãªã¬ãã¼ã¸ã³ã¬ã¯ã¿ã¨ãè¨ããã Sadayuki Furuhashi @frsyuki @kumagi å ¨ã¹ã¬ãããrcu_quiescent_stateãå®æçã«å¼ã°ãªãã¨æç«ããªãæ°ããã¾ããããã¼ã¿ã®èªã¿åºããè¡ããªãã¹ã¬ããã¨ãããã¾ã«è¡ããªããªãã¹ã¬ããã¯ãã©ãããã¿ã¤ãã³ã°ã§rcu_quiescent_stateãå¼ãã§ãããã§ããï¼ ãã¾ã @kumagi @frsyuki ãããã®æ¬ ç¹ã«æ°ã¥ãã¦ãã¾ãã¨ã¯ãããã§ãããä»ã®UserspaceRCUãã¿ããªRW-Lockã®ä»£ããã«ã使ããï¼ãããä½ç½®ãã·ã°ããã£ãä¸è´ããã®ã§ãã¤ããªã®ãªã³ã¯å ãå¤ããã ãã§è¯ãï¼ä¸æ¹ã§QSBRã¯ã¢ã«ã´ãªãºã ä¸ã«ä¾µå ¥çã«å¤
http://lttng.org/urcu|Userspace RCU ã¨ãã大å¤ã¯ã¼ã«ãªããã¸ã§ã¯ããããã¾ãã ãRCUï¼ãªã¼ãã³ãã¼ã¢ãããã¼ãï¼ãã¦ã¼ã¶ã¼ã¹ãã¼ã¹ã§è¡ããã®ãã¨ããäºã§ãããã ãèãã¨ãªãã®ãã£ã¡ãã¨ããæãã ãªã¼ãã³ãã¼ã¢ãããã¼ãã£ã¦ä½ã ãªã¼ãã³ãã¼ã¢ãããã¼ããã®ãã®ã®æ£ãã説æã¯Wikipedia*1 ã§ãèªãã§ãããã¨ãã¦ãWikipediaãèªãã®ããé¢åãªäººã®çºã«èª¬æããã¨ãã¿ããªã§å ±æãã¦ããã¼ã¿ãfree()ãã¦ãè¯ãã¿ã¤ãã³ã°ãè¦æ¥µããæè¡ãã§ãã ç¹å®ã®æ§é ä½ãã¿ããªã§å ±æãã¦æ¸ãæãããããããªãâãLockã¨ãã°ãããï¼ ãããé »ç¹ã«ã¢ã¯ã»ã¹ãããèªã¿åºãã®æ¹ãå¤ãããLockã¯ãã ãªãâãRead-Write Lockã§ãããï¼ Read-Write Lockã ã¨Atomicå½ä»¤å¤ããã¦ããã©ã¼ãã³ã¹ã§ãªããªãâãLockç¡ããã¦ãã¼
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}