3月 252014
 

 

缘起

对于多个进程同时往一个日志文件中写日志时,如果并发非常大,对日志文件加锁会产生很大的开销,严重影响服务器的性能。那么能不能不加锁呢?

 

参考资料:

http://stackoverflow.com/questions/9096470/atomically-appending-a-line-to-a-file-and-creating-it-if-it-doesnt-exist

http://www.chinaunix.net/old_jh/23/829712.html

 Posted by at 下午 5:45

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据