xiaofan
xiaofan
> @raliste that sounds smart, I will give it a try. Thanks ! > > Update: thanks a lot, I used what you suggested with goroutines and I am down...
@PuKoren Thanks for your sharing. It's very helpful.
@PuKoren Hello, I'm so sorry to bother you again. Below is my code. Some pdf work well and faster,but some pdf got segmentation violation error and looks like non-random. I...
@PuKoren Thank you for your reply, this problem still exists, even if I use built-int func 'copy' to copy input byte slice for each goroutine. For most cases,it works fine,but...
> @xiaoxfan are those PDF working when processed without goroutines with a single gofitz instance? Yes
> @xiaoxfan If you use the same code I pasted here you get the same issue? Yes, only a few specific pdf files (5 pages,no obvious difference from the others)...
> @xiaoxfan I think it would be hard to debug without the PDF files to try locally > however I don't have enough time now to do it, so I...
singleflight这样理解对不对: 在一瞬间有大量请求get(key),而且key未被缓存或者未被缓存在当前节点 如果不用singleflight,那么这些请求都会发送远端节点或者从本地数据库读取,会造成远端节点或本地数据库压力猛增。使用singleflight,第一个get(key)请求到来时,singleflight会记录当前key正在被处理,后续的请求只需要等待第一个请求处理完成,取返回值即可。
> @geektutu > > add方法最后的那段for是不是应该改为if才对? > > for 是没问题的,可能会 remove 多次,添加一条大的键值对,可能需要淘汰掉多个键值对,直到 `nbytes < maxBytes`。 #### 更新之后也可能需要淘汰,不能直接return ``` // Add adds a value to the cache. func (c *Cache) Add(key string,...