私房话

“I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living, it’s a way of looking at life through the wrong end of a telescope. Which is what I do, and that enables you to laugh at life’s realities.” - Dr. Seuss

Nothing to see here

You seemed to have found a mislinked file, page, or search query with zero results. If you feel that you've reached this page in error, double check the URL and or search string and try again.

Alternatively, a more personalized method of tracking down and searching for content can be found below.


February 20th 2010
Tags: Uncategorized No Comments

小心多线程开发

程序如果特别复杂,特别是做Server的程序,不可避免的需要利用多线程来提高运行效率,就不可避免的会遇到多线程开发一些常见的问题: 为了能合理的使用共享资源,必须利用锁机制; 滥用了锁机制,就会增加deadlock的风险,且不容易发现。 写多线程程序,特别需要小心翼翼,首先应当尽量减少共享资源。锁不可避免的时候,尽量减少在锁内部的工作量,临界区越少越好。最好避免锁内代码再去获取其他锁!如果你还是不可避免的这样做了,需要确保这样做的正确性。随意加锁来保持线程安全事实上是一种很危险的做法。
February 7th 2010
Tags: Uncategorized No Comments

最近的读书计划

手上有好多本待读的书,和好多件待做的事情。我发现我老是同时开始很多时间,而搞的自己手忙脚乱。 手头有 祖国的陌生人 1% 吴敬琏传 5% 集体智慧编程 5% 程序员的自我修养 30% 每本书都有进度,但都没看完,准备把今天吴敬琏传先看一下。 还有在看一本电子书,看电子书总是觉得不舒服,一种做贼的感觉,可是,国内没有出版,我也没办法。 女朋友是策划编辑,因此我手头堆的书越来越多,对一个爱书的人而言,不知道是不是能算好事?

Search

The archives run deep. Feel free to search older content using topic keywords.

Browse by Category