Saturday, November 17, 2007
counter with concurrency
การเพิ่ม counter เวลาสั่งให้ตัวนับเพิ่มไป +1 แล้ว ให้แสดงผลกลับออกมา ไม่จำเป็นต้องคำนึงถึงเรื่อง concurrency มากก็ได้ คือไม่จำเป็นตัองกังวลมากว่าค่าที่ส่งกลับมา จะเป็นค่า counter ในขณะนั้นจริงๆหรือไม่ (กรณีที่มีคนเพิ่ม counter เหมือนกันในช่วงนั้น) เพราะว่าคนเพิ่มก็ไม่รู้หรอกว่ามีอีกคนกำลังเพิ่มอยู่ และเพิ่มมาเมื่อตอนไหน แค่ refresh หน้าจอ แล้วค่ามันเปลี่ยนไปเป็นค่าที่แท้จริงก็พอ
Subscribe to:
Post Comments (Atom)
1 comment:
Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Smartphone, I hope you enjoy. The address is http://smartphone-brasil.blogspot.com. A hug.
Post a Comment