看板 Oversea_Job 關於我們 聯絡資訊
板上神人大大們可能覺得太小兒科,半路出家的小弟斗膽一猜(抖~~) 因為要high concurrency所以要lock specific node, 不能lock整個list或tree 最簡單的方式就是在node class加上lock()跟unlock() 用java的話java 1.5有已經寫好的package java.util.concurrent 題目一的答案可以看看java.util.concurrent.ConcurrentLinkedQueue或 synchronousQueue的實作 這個情況在實務上其實很常遇到,我們公司的產品還在1.4.2所以我自己寫了一個 類似的....╮(﹋﹏﹌)╭.. ※ 引述《[email protected] (Go cubs!)》之銘言: : ※ 引述《LINC (Go cubs!)》之銘言: : : 1. How to lock a linked-list? : : 2. How to lock a binary tree? : : These questions may require the highest level of concurrency. : Nobody wants to play with these questions? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 76.111.69.123