Generated by All in One SEO v4.9.3, this is an llms.txt file, used by LLMs to index the site. # Parallel Labs Be a lifelong learner with a natural curiosity to figure out how the world works, and an architect with passion to shape the world to come by crafting the next big thing. Don't worry dude, just hacking! ## Sitemaps - [XML Sitemap](https://www.parallellabs.com/sitemap.xml): Contains all public & indexable URLs for this website. ## 文章 - [Architect和Artisan](https://www.parallellabs.com/2020/12/04/architect-and-artisan/) - 突然发现Sologan里面后半句没有写名词。与开始从“工匠”和“架构师”两个词中进行对比筛选。最后选了黑客帝国 - [创业与企业家精神](https://www.parallellabs.com/2020/07/22/why-build-a-startup/) - 什么是企业家精神? - [增长二三事](https://www.parallellabs.com/2019/03/11/notes-on-growth/) - 最近对增长有了一些新的思考,正好又听了Hola Group Growth负责人Daisy的一次分享,把一些心得 - [Shape the world to come](https://www.parallellabs.com/2018/09/20/shape-the-world-to-come/) - 2018年9月20日。 很有意思的一天。 一整天大部分时间,都在想怎么在业务上突破的事情,沉醉其中。 今天最大 - [2018新年目标](https://www.parallellabs.com/2018/02/20/30-years-goal/) - 2018年,3个目标: 夯实基础,继续打造细分领域业界第一的产品和服务 带家人去旅行 减重20斤 2018年, - [人工智能芯片公司招聘工程师/行政/出纳](https://www.parallellabs.com/2016/04/04/cambricon-hiring/) - 我的好朋友陈云霁、陈天石是中科院计算所的研究员,他们课题组研发的寒武纪深度学习处理器斩获了国际顶级会议ASPL - [采访Hadoop创始人Doug Cutting纪要](https://www.parallellabs.com/2020/06/09/doug-cutting-interview/) - 2020年6月9日,无意在Wordpress草稿箱发现了11年跟@董世晓一起对Doug Cutting的采访纪要。感谢世晓和CSDN给我这个机会。9年之后回顾这个采访内容,还觉得很有意思。一个影响行业的技术大牛,都是在一个技术领域深耕多年的。而最早开源的原因,竟然是Doug想复用他写的代码:) - [智能优化&AB测试-实验驱动用户增长@QCon10 PPT分享](https://www.parallellabs.com/2019/05/26/abtesting-and-user-growth/) - 这次在“用户增长”Session做了一个分享,标题是“智能优化 & A/B 测试 - 实验驱动用户增长 - [Druid 6th Meetup资料下载](https://www.parallellabs.com/2019/03/18/druid-6th-meetup/) - Druid 6th Meetup资料下载:链接: https://pan.baidu.com/s/1gfvgt - [两个平行世界](https://www.parallellabs.com/2019/02/24/two-parallel-worlds/) - 一个是虚拟世界,一个是物理世界。 PC时代,两个世界间的通道,大部分是PC机。 移动互联网时代,两个世界间的通 - [Druid中国用户组第一次线下技术交流资料分享](https://www.parallellabs.com/2016/03/29/druid-1st-meetup/) - Druid(http://www.druid.io)作为一个开源的大数据OLAP分析引擎,得到了越来越多的关注 - [Thank you from G.C. Guancheng Chen](https://www.parallellabs.com/2015/06/29/thank-you-from-gc-guancheng-chen/) - Dear friends, colleagues and mentors, Tomorrow (Jun 30t - [怎样做颠覆式创新?](https://www.parallellabs.com/2015/06/03/disruptive-innovation/) - 关于怎样做颠覆式创新,普林斯顿的李凯教授给出了四个要素: (1)找到最好的合伙人 (2)理解市场需求(例如你是 - [一步一步教你怎样给Apache Spark贡献代码](https://www.parallellabs.com/2014/08/05/how-to-contribute-to-spark-step-by-step/) - 本文将教大家怎样用10个步骤完成给Apache Spark贡献代码这个任务:) 到 Apache Spark - [基于OpenStack, Docker和Spark打造SuperVessel大数据公有云](https://www.parallellabs.com/2015/05/12/supervessel-spark-as-a-service-with-openstack-and-docker/) - 今年4月的Spark技术峰会上我做了《SuperVessel:基于OpenStack, Docker和Spar - [Impala与Stinger对比](https://www.parallellabs.com/2013/08/01/impala-vs-stinger/) - Tez和Impala现在竞争非常激烈,前者走的是基于DAG的精细化管理,后者是基于MPP的技术架构重头开始造了 - [大数据的价值密度](https://www.parallellabs.com/2014/05/03/value-of-big-data/) - 文 / 陈冠诚 注:原文刊载于《程序员》2014年第5期,略有删改。 在大数据和云计算如火如荼的今天,怎样将数 - [给Vim配置Scala语法高亮显示](https://www.parallellabs.com/2015/04/11/vim-syntax-highlight-for-scala/) - 第一步,执行下面这个脚本: mkdir -p ~/.vim/{ftdetect,indent,syntax} - [IBM研究院(CRL)诚聘 Bigdata/Clould 方向正式员工 ](https://www.parallellabs.com/2014/03/11/crl-bigdataclould-job/) - 工作地点:北京 工作职位:正式员工 IBM中国研究院是IBM技术力量最强的部门,在新技术研发,前沿学术研究,高 - [Impala:新一代开源大数据分析引擎](https://www.parallellabs.com/2013/08/25/impala-big-data-analytics/) - 原文发表在《程序员》杂志2013年第8期,略有删改。 文 / 耿益锋 陈冠诚 大数据处理是云计算中非常重要的 - [My Way](https://www.parallellabs.com/2013/09/22/my-way/) - 这一年经历了很多低谷,很多困惑。思索了许多类似于“人从哪里来,要到哪里去”这类的问题。 最近终于有一点点感悟: - [多线程程序常见Bug剖析(上)](https://www.parallellabs.com/2010/11/13/concurrency-bugs-1/) - 编写多线程程序的第一准则是先保证正确性,再考虑优化性能。本文重点分析多线程编程中除死锁之外的两种常见Bug:违反原子性(Atomicity Violation)和违反执行顺序(Ordering Violation)。现在已经有很多检测多线程Bug的工具,但是这两种Bug还没有工具能完美地帮你检测出来,所以到目前为止最好的办法还是程序员自己有意识的避免这两种Bug。本文的目的就是帮助程序员了解这两种Bug的常见形式和常见解决办法。 阅读全文>> - [为什么程序员需要关心顺序一致性(Sequential Consistency)而不是Cache一致性(Cache Coherence?)](https://www.parallellabs.com/2010/03/06/why-should-programmer-care-about-sequential-consistency-rather-than-cache-coherence/) - 本文适合的对象是想用C++或者Java进行多线程编程的程序员。本文主要包括对Sequential Consistency和Cache Coherence的概念性介绍并给出了一些相关例子,目的是帮助程序员明白为什么需要在并行编程时关注Sequential Consistency。 - [浅析C++多线程内存模型 ](https://www.parallellabs.com/2011/08/27/c-plus-plus-memory-model/) - 注:本文发表于《程序员》2011年第6期并行编程专栏,略有删改。 在即将到来的C++1x标准中,一个重大的更新就是引入了C++多线程内存模型。本文的主要目的在于介绍C++多线程内存模型涉及到的一些原理和概念,以帮助大家理解C++多线程内存模型的作用和意义。 阅读全文>> - [Facebook的Realtime Hadoop及其应用](https://www.parallellabs.com/2011/07/17/realtime-apache-hadoop-at-facebook/) - 在今年的SIGMOD‘11上,Facebook又发了一篇新paper(点此下载),讲述了它们在提高Hadoop实时性上的工作及其应用。简单来讲,他们的项目需求主要有: 1. Elasticity(伸缩性) 2. High write throughput(高写吞吐量) 3. Efficient and low-latency strong consistency semantics within a data center(单个data center内高性能、低延迟的强一致性) 4. Efficient random reads from disk(disk的高性能随机读) 5. High Availability and Disaster Recovery(高可靠性、灾后恢复能力) 6. Fault Isolation(错误隔离) 7. Atomic read-modify-write primitives(read-modify-write原子操作) 8. Range Scans(范围扫描) 阅读全文>> - [《程序员的自我修养》中关于加锁不能保证线程安全的一个错误](https://www.parallellabs.com/2011/04/09/pthread-mutex-lock-and-thread-safety/) - 在《程序员的自我修养 -- 链接装载与库》一书第28页“过度优化”这一节中,作者提到了编译器优化可能造成多线程bug的情况。但是《程》中所给出的例子其实是错误的。Pthreads线程库帮程序员保证了pthread mutex(spin lock也一样)所保护的临界区内共享变量的可见性:即Thread 1一执行完unlock(),x的最新值1一定能被Thread 2看见。(为了实现这一点,Pthreads线程库在实现的时候都会根据相应的硬件平台调用相应的memory barrier来保证内存可见性,感兴趣的同学可以看看nptl的实现)所以,只要正确的用锁保护好你的共享变量,你的程序就会是线程安全的。 阅读全文>> - [并行编程中的“锁”难题](https://www.parallellabs.com/2011/10/02/lock-in-parallel-programming/) - 注:本文发表于《程序员》2011年第8期并行编程专栏,略有删改。 在并行程序中,锁的使用会主要会引发两类难题:一类是诸如死锁、活锁等引起的多线程Bug;另一类是由锁竞争引起的性能瓶颈。本文将介绍并行编程中因为锁引发的这两类难题及其解决方案。 阅读全文>> - [X-RIME: 基于Hadoop的开源大规模社交网络分析工具](https://www.parallellabs.com/2012/01/09/xrime/) - 随着互联网的快速发展,涌现出了一大批以Facebook,Twitter,人人,微博等为代表的新型社交网站。这些网站用户数量的迅速增长使得海量的用户数据不断被产生出来,而如何有效地对这些海量的用户数据进行社交网络分析(Social Network Analysis)正成为一个越来越热门的问题。本文向大家介绍由IBM中国研究院和北京邮电大学合作开发的X-RIME开源库(http://xrime.sourceforge.net/),一个基于Hadoop的开源社交网络分析工具。 其实早在90年代初就已经有许多企业和研究机构对社交网络进行过相关研究。然而随着互联网用户的急速的增长,今日的社交网站所需处理的数据已经不是传统的解决方案所能够应对的了。例如,传统的社会网络分析算法和工具往往都是单机形式的,在面对大规模数据集的时候往往会出现存储和处理能力不足等方面问题,再加上原始输入数据和社会网络的内部表示大都属于无结构或者半结构化数据,传统关系数据库并不擅长处理此类数据,使得利用传统的社会网络分析算法和工具对大规模数据集进行处理变得更加困难。另一方面,随着Hadoop的日益流行,许多中小互联网企业可以通过搭建Hadoop集群来方便地进行大规模数据处理。然而,Hadoop并不直接提供社交网络分析的算法库,因此实施海量社交网络分析仍存在较高门槛。基于这些需求,我们设计并实现了X-RIME。 X-RIME是一个基于Hadoop的开源社会网络分析工具。依赖于Hadoop提供的大规模数据并行处理能力,X-RIME实现了对十几中网络分析算法的并行化,提供了一整套用于对大规模社会网络进行分析处理的解决方案。通过使用X-RIME,用户可以方便快捷地对海量社会网络数据进行分析,从这些海量社会网络数据中获取更深层次的有用信息,从而进一步挖掘商业价值,支持商业决策以及发现新的业务增长点。 阅读全文>> - [云计算时代的多核开发](https://www.parallellabs.com/2012/01/22/multicore-programming-in-cloud-era/) - 注:原文发表于《程序员》杂志2011年第12期,略有删改。 云计算和多核这两大趋势正对软件开发者产生重大影响。近几年,多核逐渐成为主流:随着提升CPU核心频率越来越难,处理器厂商选择了更加容易实现的多核方案来继续提升硬件的性能。进入后PC时代,移动处理器也同样面临着性能的提升与功耗的控制这两大挑战,为了满足提升性能与控制功耗的需求,多核也正成为其以后发展的方向。另一方面,云计算也渐渐成为软件开发的大势。在云计算的生态系统中最主要的设备是“端”和“云”。所谓端包括移动设备(智能手机,Pad等)和传统的PC,尤其是前者;而云指的就是由高性能服务器组成的大规模集群,它们向端设备提供各种服务支持。在云计算时代进行多核开发会是一幅什么样的场景?这两大趋势彼此会有什么样的影响?我们不妨先回顾一下在大型机和PC机时代软件开发的历史。 阅读全文>> - [Intel Nehalem微处理器架构 by Glenn Hinton (Intel Fellow)](https://www.parallellabs.com/2012/04/28/intel-nehalem-microarchitecture/) - Intel的Nehalem是一个空前成功的设计。做架构最重要的本事就是学会做折衷(Tradeoff)。 Nehalem的Lead Architect Glenn Hinton在Stanford ee380这门课上详细讲解了Nehalem设计时的几个关键选择,特此分享给大家。 - [多核与异步并行](https://www.parallellabs.com/2013/01/21/multicore-and-asynchronous-communication/) - 我们在设计多线程程序时往往有很多性能指标,例如低延迟(latency),高吞吐量(throughput),高响应度(responsiveness)等。随着多核处理器上CPU核数的日益增加,如何高效地利用这些计算资源以满足这些设计目标变得越来越重要。这次向大家介绍的异步并行就是一种帮助实现低延迟、高吞吐量和高响应度的并行编程技术。 - [Facebook技术分享: Social Networking at Scale](https://www.parallellabs.com/2012/05/30/facebook-social-networking-at-scale/) - 在HPCA'12大会上,来自Facebook的Sanjeev Kumar做了题为“Social Networking at Scale”的技术演讲,主要对Facebook在可扩展的软/硬件架构上的挑战做了分析,特地分享给大家。 - [为什么NoSQL和Hadoop该一起使用?](https://www.parallellabs.com/2012/05/17/nosql-and-hadoop/) - Cloudera和CouchBase最近以“为什么NoSQL和Hadoop该一起使用?”为题做了个主题分享,其中对传统IT架构和Big Data架构做了很好的对比,很值得一看。 - [Git快速学习指南](https://www.parallellabs.com/2013/07/22/git-quick-learning-guide/) - 写在前面的话 学习是一个永无止境的过程,举个例子,学习“学习的方法”是一个不断迭代的过程:随着个人经历、周围环 - [记一次诡异的Debug经历](https://www.parallellabs.com/2013/03/21/debug-experience/) - Debug需要有刨根问底和百折不挠的精神。曙光往往在你被折磨的体无完肤之时出现,顿时你觉得整个世界都是光明的。 - [下一代大数据分析技术](https://www.parallellabs.com/2013/03/08/next-gen-big-data-analytics/) - 原文发表于《程序员》杂志2013年第2期. 文 / 陈冠诚 随着以Hadoop为代表的大数据分析技术的普及,大 - [仰望星空 脚踏实地](https://www.parallellabs.com/2013/03/21/career-sky-and-ground/) - 最近连续跟IBM的一位VP和一位Fellow有过交流,对“仰望星空,脚踏实地”有了一些新的体会,特在此分享。 - [与Google拼音的工程师聊聊中文滑行输入](https://www.parallellabs.com/2013/07/04/google-pinyin/) - 前一阵子Google拼音输入法加入了中文滑行输入功能,我因为去年和同事一起发过一个输入法的专利,对输入法的创新 - [C++ AMP异构并行编程解析](https://www.parallellabs.com/2012/05/09/cplusplus-amp-programming/) - 原文发表于《程序员》杂志2012年第4期,略有改动。 文 / 陈冠诚 微软在今年2月份的GoingNative大会上正式对外发布了C++ AMP(Accelerated Massive Parallelism)开放规范。C++ AMP是微软于11年6月推出的一个异构并行编程框架,从Visual Studio 11开发者预览版起,微软正式提供了C++AMP的支持。C++ AMP的目标是降低在由CPU和GPU共同组成的异构硬件平台上进行数据并行编程(data parallel)的门槛。通过C++ AMP,开发者将获得一个类似C++ STL的库,这个库将作为微软concurrency namespace的一部分,开发者既不需要学习新的C++语法,也不需要更换编译器就能够方便地进行异构并行编程。本文主要介绍C++ AMP的设计原则和语法规则,并将其与CUDA和OpenCL这两个已有的异构并行编程框架进行了对比,希望对大家了解异构并行编程有所帮助。 阅读全文>> - [做好失败的准备](https://www.parallellabs.com/2012/07/14/get-ready-for-failure/) - 这周二晚上收到了SC'12大会的邮件通知,我的论文终于被接收了.在被SC'12录取之前,我这篇文章分别被IPDPS,ICS和SC据过,每一次被拒都得到了非常多有帮助的评审意见,帮助我更好的改进这篇文章.当然,被拒的滋味不好受.我认识的众多好友投顶级会议纷纷一投就中(例如madong的IJCAI, jiayu的NIPS和SIGIR, yang xi的ASPLOS和OOSPLA),我被拒了那么多次咋还没中呢,心里的挫败感多多少少还是有一点. 不过现在回头来看,最大的体会就是:要想做成一件公认的不太容易的事情,你必须做好失败的准备.Per在第一次投稿的时候跟我说,"没事,你投ICS吧,把目标设的高一点好".现在想来,就是要给自己设定一个超出自己能力的目标,才能激发出自己的潜能:) 当然,既然你给自己设定了一个比较高的目标,你就一定要清楚的认识到,这件事情不是那么容易成功的.你必须把工作做到位,做扎实,过了那个门槛才行.而这个门槛的高度可能需要你付出非常多的努力.具体到SC'12的这篇论文上,因为是系统相关的题目,所以必须要把实验部分做的非常扎实才能让审稿人满意,向我这样的普通人,自然需要努力努力再努力才能成功. 大家都在讲成功,都想要成功,殊不知成功之前大都要经历失败,尤其是在令人瞩目的成功之前,更是如此.比如说,你想成为一名优秀的程序员,可能需要10年的苦工.比如说,你想要在ISCA发一篇有影响力的文章,可能需要做个三四年扎实的工作才行.比如说,你想创办一家成功的公司并上市,可能需要10年的时间并经历千辛万苦.当然,除了努力之外,还有另外一个非常重要的因素,那就是洞察力.如果能发现一个新的热点,自然就能站在浪潮之巅成为风云人物,不过那是另一个故事了,发现问题永远比解决问题要难嘛. 把目标设的高一点,然后朝着那个目标的门槛努力,中间失败了也不要紧,因为每失败一次,离成功就近了一分. - [剖析为什么在多核多线程程序中要慎用volatile关键字?](https://www.parallellabs.com/2010/12/04/why-should-we-be-care-of-volatile-keyword-in-multithreaded-applications/) - 这篇文章详细剖析了为什么在多核时代进行Java/C/C++多线程编程时需要慎用volatile关键字。 - [Understanding System and Architecture for Big Data](https://www.parallellabs.com/2012/05/09/understanding-system-and-architecture-for-big-data/) - 简介:IBM Research最近在Big Data领域有很多工作,例如我们组在4月份在10台采用POWER7处理器的P730服务器上成功地用14分钟跑完了1TB数据的排序(7月份又在10台Power7R2上用8分44秒跑完了1TB排序),这项工作已经发表为一篇IBM Research Report,欢迎大家围观,并提出宝贵意见,谢谢。 The use of Big Data underpins critical activities in all sectors of our society. Achieving the full transformative potential of Big Data in this increasingly digital world requires both new data analysis algorithms and a new class of systems to handle the dramatic data growth, the demand to integrate structured and unstructured data analytics, and the increasing computing needs of massive-scale analytics. In this paper, we discuss several Big Data research activities at IBM Research: (1) Big Data benchmarking and methodology; (2) workload optimized systems for Big Data; (3) case study of Big Data workloads on IBM Power systems. In (3), we show that preliminary infrastructure tuning results in sorting 1TB data in 14 minutes on 10 Power 730 machines running IBM InfoSphere BigInsights. Further improvement is expected, among other factors, on the new IBM PowerLinuxTM 7R2 systems. By: Anne E. Gattiker, Fadi H. Gebara, Ahmed Gheith, H. Peter Hofstee, Damir A. Jamsek, Jian Li, Evan Speight, Ju Wei Shi, Guan Cheng Chen, Peter W. Wong Published in: RC25281 in 2012 LIMITED DISTRIBUTION NOTICE: This Research Report is available. This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g., payment of royalties). I have read and understand this notice and am a member of the scientific community outside or inside of IBM seeking a single copy only. 下载链接 Questions about this service can be mailed to reports@us.ibm.com . - [[已经招到了,谢谢大家!]IBM中国研究院招聘Hadoop实习生](https://www.parallellabs.com/2011/09/22/internship-on-hadoop/) - 我们组最近有一个实习生的名额,做Hadoop性能优化相关的研究工作,如果大家感兴趣的话请给我发邮件:) IBM Research China is looking for graduate computer science/engineering students who are interested in Hadoop performance optimizations works. Location: Beijing Job Tile: Research Intern Job Openings: 1 Expected Duration: at least 3 months (full-time preferred) Job responsibilities: - Write MapReduce program and analyze Hadoop performance model. - Tune and optimize the performance of Hadoop workloads. - Publish high quality research papers to report your work. Requirements: - Creative and Self-motivated - Knowledge of Parallel Computing and Distributed Systems. - Knowledge of Java. - Familiarity with Linux as development and testing environments. - Knowledge of Apache Hadoop is a plus. - Past research experience is a plus. If you're interested, please feel free to send your Chinese or English resume with the mail title of "Intern_Your Name_University_Major_Grade" (e.g. Intern_Zhang San_XXU_CS_Master) to chengc_at_cn.ibm.com. - [IBM中国研究院招聘大规模数据分析实习生](https://www.parallellabs.com/2011/09/02/ibm-research-china-internship/) - 帮同事发文,招聘实习生: IBM Research China is looking for undergra - [Erlang User Conference 2010见闻(兼谈程序员职业生涯)](https://www.parallellabs.com/2010/11/29/erlang-user-conference-2010-and-some-thoughts-on-career-of-programmers/) - 这是我第一次参加关于Erlang的技术大会,总来的说收获非常大,不管是技术上的还是非技术上的都是如此。首先不得不说的是会议举行的地点。我从别人那得知之前的会议一直都是在Ericsson的总部大楼举行的,但是因为参会人数越来越多,好像是从去年开始就转移到市中心一个很有历史的电影院ASTORIA举行了。由于这个举办地是电影院的缘故,从去年开始EUC就开始有电影海报了!去年海报是由哈利波特改的,今年的是星球大战。 阅读全文>> - [实施并行编程的五大障碍](https://www.parallellabs.com/2010/03/22/five-obstacles-that-slow-down-parallelism/) - 近期看见一篇来自Intel的很有意思的分析文章,作者提到在他向45名与会的各公司程序员/开发经理/战略师提问“什么是实施并行编程的最大障碍”时,下面五个因素被提及的次数最多:遗留代码(legacy code)、教育(education)、工具(tools)、对众核趋势的恐惧(fear of many cores)以及可维护性(maintainability)。文章虽然是一篇Intel Parallel Studio的软文,但是其中提及的这五大障碍却非常值得讨论,下面是我对这五大障碍的一些粗浅看法,希望能起到一个抛砖引玉的作用,欢迎大家给出你们的看法。 阅读全文>> - [你好,2011!](https://www.parallellabs.com/2011/01/01/hello-2011/) - 2010年总结与2011年计划。 阅读全文>> - [多核编程的难题(一)](https://www.parallellabs.com/2010/08/17/the-trouble-with-multicore/) - 最近David Patterson老爷子(就是计算机体系结构--量化方法的作者之一)发表了一篇文章《The trouble with multicore》,文章高屋建瓴的分析了一下多核发展的当前形势,文章开篇就说了一句话“造芯片的家伙们正忙着生产那些大多数程序员不知道如何编程的多核CPU”。这不由的让我想起我跟我导师Per Stenstrom的一次对话,我问他说“现在多核出来了,有一大堆新的难题等着我们去解决,作为研究人员您是否觉得很兴奋呢?”结果他说“其实我还是有点沮丧的,因为我们是被迫转到多核上来的。” > - [多线程队列的算法优化](https://www.parallellabs.com/2010/10/25/practical-concurrent-queue-algorithm/) - 多线程队列(Concurrent Queue)的使用场合非常多,高性能服务器中的消息队列,并行算法中的Work Stealing等都离不开它。对于一个队列来说有两个最主要的动作:添加(enqueue)和删除(dequeue)节点。在一个(或多个)线程在对一个队列进行enqueue操作的同时可能会有一个(或多个)线程对这个队列进行dequeue操作。因为enqueue和dequeue都是对同一个队列里的节点进行操作,为了保证线程安全,一般在实现中都会在队列的结构体中加入一个队列锁(典型的如pthread_mutex_t q_lock),在进行enqueue和dequeue时都会先锁住这个锁以锁住整个队列然后再进行相关的操作。这样的设计如果实现的好的话一般性能就会很不错了。但是它其实有一个潜在的性能瓶颈,导致在线程数增多时极大的影响多线程程序的性能。 > - [移动设备进入多核时代!](https://www.parallellabs.com/2010/12/28/multicore-and-mobile-devices/) - Nvidia最近发布了代号为Tegra 2的新一代双核移动处理器,移动设备即将进入多核时代。该款处理器由两个基于ARM Cortex A9的核心及其它视频音频图形专用核心(可看成Accelerator)组成,是一个典型的异构(Heterogeneous)平台。这个平台的关键特征有两个:低功耗(比高频单核的处理器耗电小),高性能(异构平台的性能优势)。 阅读全文>> - [多核的未来](https://www.parallellabs.com/2010/10/03/future-multiprocessors/) - UT Austin的Yale Patt教授上个月来Chalmers交流,做了题为《Future Microprocessors: Multi-core, Mega-nonsense, and What We Must Do Differently Moving Forward》的讲座。Yale Patt是计算机体系结构学术圈的巨擘,他最有名的研究成果是和Branch Predictor和HPS microarchitecture,他的学生们也巨牛无比,学术界有名的有UIUC的Wen-Mei Hwu,CMU的Onur Mutlu等等,工业界Intel不少核心工程师也出自他的门下。这个讲座主要谈了他对未来的多核处理器的发展的看法,有趣的是他二十年前也预测过现在的处理器,我还专门问了他当时的预测是否靠谱,他说“那我得回去查查看才行”,人非常的Nice。 阅读全文>> - [多线程程序常见Bug剖析(下)](https://www.parallellabs.com/2010/11/23/concurrency-bugs-2/) - 上一篇文章我们专门针对违反原子性(Atomicity Violation)的多线程程序Bug做了剖析,现在我们再来看看另一种常见的多线程程序Bug:违反执行顺序(Ordering Violation)。 简单来说,多线程程序各个线程之间交错执行的顺序的不确定性(Non-deterministic)是造成违反执行顺序Bug的根源[注1]。正是因为这个原因,程序员在编写多线程程序时就不能假设程序会按照你设想的某个顺序去执行,而是应该充分考虑到各种可能的顺序组合,从而采取正确的同步措施。 阅读全文>> - [多线程程序中操作的原子性](https://www.parallellabs.com/2010/04/15/atomic-operation-in-multithreaded-application/) - 原子操作就是不可再分的操作。在多线程程序中原子操作是一个非常重要的概念,它常常用来实现一些同步机制,同时也是一些常见的多线程Bug的源头。本文主要讨论了三个问题:1. 多线程程序中对变量的读写操作是否是原子的?2. 多线程程序中对Bit field(位域)的读写操作是否是线程安全的?3. 程序员该如何使用原子操作? > - [Proposal for the “Search and sort” competition of Findwise](https://www.parallellabs.com/2009/12/30/proposal-for-the-search-and-sort-competition-of-findwise/) - In this April I took part in a competition hold by Findwise and Mriday which is about search technology. Search and Sort | Findwise Current, Search and Sort | Findwise April 25th, 2009 We are constantly acquiring innovative ideas and solutions in the field of search technology. Therefore we have created the following contest to discover people who are interested in joining Findwise and build next generation’s search technology. Project overview The name of this contest is called Search and Sort. We can start by looking at an example which everybody is familiar with, Google. The Google search engine is the most used search engine on the Web. The search results generated from it includes webpages, PDF, Word documents, Excel spreadsheets, Flash, videos etc. For any query, up to the first 1000 results can be shown with a maximum of 100 displayed per page. 阅读全文>> - [09年感悟](https://www.parallellabs.com/2009/12/31/09-summary/) - 上半年顺风顺水,有付出也有收获,良好的状态持续到暑假实习结束。下半年压力陡增,主要包括就业压力和毕设压力。一个是因为国内就业竞争的激烈,另一个是因为十分具有挑战性的毕设课题。 压力。有压力是好事,在恰当的时候它能转换为我的动力,督促我的行为,间接促进我的进步。但是对待压力也要心态平和,不要过于焦虑、消沉,否则会陷入非常被动的局面。看过一句话,压力大就是因为自信心不足。自信心是建立在刻苦的努力之上的。所以最好的状态还是Take it easy,找准最需要下功夫的地方,多勤奋一点,多努力一点,付出的比别人多自然就有丰厚的回报,而且随着一点一滴的积累,自信心自然也就来了。 定位。首先是找到并持续的激发自己的兴趣点,从事自己真正发自内心喜欢并且觉得有意义的事情,这往往是成功的第一步。不要被所谓的“热潮”牵着鼻子走,分散了自己的注意力不说,这些不是自己最感兴趣的事情往往也不太适合自己。最好的学习和工作状态是每天早晨睁开眼就很兴奋很期待今天要做的事情,不管是它能给他人带来很积极的影响,或是能提升自己的专业技能,都能给自己带来满足感、成就感。最怕的就是对事情只有三分钟热情,当几天过去热情不在,或是碰到困难后就放弃,这样往往最后就是竹篮打水一场空。其次就是对症下药,先找自己最薄弱的环节并积极去弥补它。不要左一下右一下,结果等到面对问题的时候那些最需要的技能还没准备好那就完了。这里引出了另一个话题,专注。 阅读全文>> - [第三次软件危机](https://www.parallellabs.com/2010/04/01/the-third-software-crisis/) - The major cause of the software crisis is that the machines have become several orders of magnitude more powerful! To put it quite bluntly: as long as there were no machines, programming was no problem at all; when we had a few weak computers, programming became a mild problem, and now we have gigantic computers, programming has become an equally gigantic problem. 造成软件危机的主要原因是因为计算机的计算能力正在呈指数级地增长!说的简单些:在没有计算机的时候,编程根本就不是一个问题;当一些计算能力较弱的计算机出现时,编程成了一个中等难度的问题,而现在,我们拥有了计算能力超绝的计算机,编程就变为了一个同样复杂的问题。 – Edsger Dijkstra, 1972年图灵奖获奖感言 阅读全文>> - [多核编程的难题(二)](https://www.parallellabs.com/2010/09/20/the-trouble-with-multicore-2/) - 刚刚过去的一个月一直都在忙着赶实验赶论文,直到前几天完成一篇短论文的写作才得以抽身来补上这一篇关于多核的曙光的文章。我将分几个方面来阐述一下我对多核上并行编程持乐观态度的原因。 1. 较易并行化的应用 如果一个应用的子任务之间依赖关系比较小,相互独立性强,那么它就具有很好的可并行性。很容易我们就会想到服务端的应用。服务端应用的特征就是为多用户提供相似的服务,因为它本身具有内在的并行性,所以相比那些子任务之间依赖性很强的应用来说,它们是比较适合多核的。这些应用常见的例子有大型数据库、飞机票预订系统、银行交易系统、网络搜索、游戏服务器以及云计算所提供的软件即服务(SaaS)等等。 阅读全文>> - [史蒂夫乔布斯(Steve Jobs)在Stanford2005年毕业典礼上的演讲](https://www.parallellabs.com/2010/10/27/steve-jobs-talked-in-stanford-2005/) - 我觉得这是我看过的最好的演讲之一。三个故事每一个都让我深受触动。 阅读全文>> - [Jeff Dean关于Google系统架构的讲座](https://www.parallellabs.com/2010/12/02/jeff-dean-on-google-system-architecture/) - 上个月Jeff Dean在Standford的Computer Systems Colloquium (EE380)这门讨论课上详细讲了讲Google的系统架构发展过程,因为这是份很新的资料,所以特意把它的Slide下下来与大家分享一下。这门课是Standford的讲座课程,每一节课都由不同的顶级工程师/科学家/投资人前来讲授IT行业的最新动向,非常非常有料,绝对值得深挖。这门课的每节课都是带视频的,Jeff Dean的这个讲座的录像在这里。 阅读全文>> - [Pthreads并行编程之spin lock与mutex性能对比分析](https://www.parallellabs.com/2010/01/31/pthreads-programming-spin-lock-vs-mutex-performance-analysis/) - Pthreads并行编程: 线程同步之spin lock与mutex性能比较 - [An interesting algorithm problem: the longest plateau](https://www.parallellabs.com/2009/11/12/algorithm-the-longest-plateau/) - 最长平台问题, longest plateau problem - [Google创始人的求职目标](https://www.parallellabs.com/2010/10/13/objective-of-sergey-brin/) - 想知道Google创始人之一的谢尔盖·布林学生时代的求职目标么? 在他Stanford的主页上的一段被注释掉了的html代码透露了他的秘密。 阅读全文>> - [Hello world!](https://www.parallellabs.com/2009/09/25/hello-world/) - Hello world! “This is Parallel Labs speaking!” - [在瑞典打甲流疫苗](https://www.parallellabs.com/2009/12/09/h1n1-vaccination-in-sweden/) - 在瑞典哥德堡打甲流H1N1疫苗 - [Launched my master thesis finally](https://www.parallellabs.com/2009/11/04/launched-my-master-thesis-finally/) - Today I talked with my supervisor again and finally and - [瑞典Ericsson总部Master Thesis面试回忆录](https://www.parallellabs.com/2010/02/04/ericsson-interview-of-master-thesis-insweden/) - 瑞典Ericsson总部Master Thesis面试回忆录, 瑞典找实习 - [聊一聊瑞典的程序员](https://www.parallellabs.com/2010/05/04/swedish-programmer/) - 在瑞典这个发达国家,IT企业的基本工资都相差不大。认识的一位Ericsson的员工(入职刚一年)工资是税前29K SEK/M(~30%的税率),资格老一点的员工能有40K~50K SEK/M。不过工资高的人交的税也会相应的增加(40%~50%),所以有一个流行的说法就是大学教授和码头工人的税后工资差不多。小公司的薪资也很不错,而且还有不同程度的股份。 > - [二进制的二三事](https://www.parallellabs.com/2010/05/15/something-about-binary-numeral/) - 二进制是计算机的自然语言,逻辑门中神奇的0/1组合犹如那起起伏伏的“滴答”之声构成了曼妙的电子世界。不仅如此,二进制中的0和1往往也是我们解决实际问题的利器。 > - [How to do performance analysis on your parallelized program efficiently?](https://www.parallellabs.com/2010/01/31/how-to-do-performance-analysis-on-your-parallelized-program-efficiently/) - Be a scientist: Gather data. Analyze it. Especially when it comes to parallelism and scalability, there's just no substitute for the advice to measure, measure, measure, and understand what the results mean. Putting together test harnesses and generating and analyzing numbers is work, but the work will reward you with a priceless understanding of how your code actually runs, especially on parallel hardware—an understanding you will never gain from just reading the code or in any other way. And then, at the end, you will ship high-quality parallel code not because you think it's fast enough, but because you know under what circumstances it is and isn't (there will always be an "isn't"), and why. --Herb Sutter 阅读全文>> - [八条设计多线程程序的简单规则](https://www.parallellabs.com/2010/02/18/8-simple-rules-for-designing-multithreaded-applications/) - 前言:最近在看该作者的《The Art of Concurrency》,里面第四章就是上面这篇文章,觉得很实用而且很有共鸣。作者基于在并行编程领域的20多年工作经验总结成上面八条简单的原则,一下子帮我把之前并行编程时的一些认识给理清了,量化了,实在是“居家旅行,并行编程,必备良药”。花了几天时间把它翻译了一下,不知道各位在看了之后是否有些共鸣呢? 阅读全文>> ## 页面 - [Quote](https://www.parallellabs.com/quote/) - “敬天爱人” - 稻盛和夫 "The only thing that never changes is cha - [Links](https://www.parallellabs.com/links/) - 云风 https://blog.codingnow.com/ 余锋 http://blog.yufeng.in - [About](https://www.parallellabs.com/about/) - Welcome to Parallel Labs! I am always interested in inn - [Research](https://www.parallellabs.com/research/) - Summary My research interest in computer architecture l - [Blog](https://www.parallellabs.com/blog/) - [Message](https://www.parallellabs.com/message/) - 欢迎大家留言给我提建议。 下次希望我写哪些方面的内容?你可以直接点此链接给你喜欢的主题投票,也可以直接留言告诉 ## 分类目录 - [并行编程](https://www.parallellabs.com/category/parallel-programming/) - [算法学习](https://www.parallellabs.com/category/algorithm-study/) - [性能分析](https://www.parallellabs.com/category/performance-analysis/) - [职业生涯](https://www.parallellabs.com/category/career/) - [业界评论](https://www.parallellabs.com/category/review/) - [生活笔记](https://www.parallellabs.com/category/life/) - [系统架构](https://www.parallellabs.com/category/system-architecture/) - [大数据](https://www.parallellabs.com/category/大数据/) - [用户增长](https://www.parallellabs.com/category/用户增长/) ## 标签 - [Chalmers](https://www.parallellabs.com/tag/chalmers/) - [Thesis](https://www.parallellabs.com/tag/thesis/) - [Algorithm](https://www.parallellabs.com/tag/algorithm/) - [年终总结](https://www.parallellabs.com/tag/年终总结/) - [性能分析](https://www.parallellabs.com/tag/性能分析/) - [Pthreads](https://www.parallellabs.com/tag/pthreads/) - [多核](https://www.parallellabs.com/tag/multicore/) - [多线程编程](https://www.parallellabs.com/tag/multithreaded-programming/) - [线程同步](https://www.parallellabs.com/tag/synchronization/) - [Interview](https://www.parallellabs.com/tag/interview/) - [面试](https://www.parallellabs.com/tag/面试/) - [Ericsson](https://www.parallellabs.com/tag/ericsson/) - [多线程内存模型](https://www.parallellabs.com/tag/memory-model/) - [线程安全](https://www.parallellabs.com/tag/thread-safe/) - [原子操作](https://www.parallellabs.com/tag/atomic-operation/) - [瑞典](https://www.parallellabs.com/tag/sweden/) - [二进制](https://www.parallellabs.com/tag/binary-system/) - [queue](https://www.parallellabs.com/tag/queue/) - [死锁](https://www.parallellabs.com/tag/deadlock/) - [jobs](https://www.parallellabs.com/tag/jobs/) - [多线程Bug](https://www.parallellabs.com/tag/concurrency-bug/) - [职业生涯](https://www.parallellabs.com/tag/职业生涯/) - [Erlang](https://www.parallellabs.com/tag/erlang/) - [Google](https://www.parallellabs.com/tag/google/) - [Architecture](https://www.parallellabs.com/tag/architecture/) - [分布式系统](https://www.parallellabs.com/tag/分布式系统/) - [volatile](https://www.parallellabs.com/tag/volatile/) - [互联网](https://www.parallellabs.com/tag/互联网/) - [移动开发](https://www.parallellabs.com/tag/移动开发/) - [memory visibility](https://www.parallellabs.com/tag/memory-visibility/) - [hadoop](https://www.parallellabs.com/tag/hadoop/) - [facebook](https://www.parallellabs.com/tag/facebook/) - [C++1x](https://www.parallellabs.com/tag/c1x/) - [ibm](https://www.parallellabs.com/tag/ibm/) - [internship](https://www.parallellabs.com/tag/internship/) - [实习](https://www.parallellabs.com/tag/实习/) - [锁竞争](https://www.parallellabs.com/tag/锁竞争/) - [Big Data](https://www.parallellabs.com/tag/big-data/) - [社交网络](https://www.parallellabs.com/tag/社交网络/) - [Social Network Analytics](https://www.parallellabs.com/tag/social-network-analytics/) - [X-RIME](https://www.parallellabs.com/tag/x-rime/) - [Open Source](https://www.parallellabs.com/tag/open-source/) - [Microarchitecture](https://www.parallellabs.com/tag/microarchitecture/) - [异构并行编程](https://www.parallellabs.com/tag/异构并行编程/) - [IBM Research](https://www.parallellabs.com/tag/ibm-research/) - [NoSQL](https://www.parallellabs.com/tag/nosql/) - [Intel](https://www.parallellabs.com/tag/intel/) - [debug](https://www.parallellabs.com/tag/debug/) - [career](https://www.parallellabs.com/tag/career-2/) - [product](https://www.parallellabs.com/tag/product/) - [weibo](https://www.parallellabs.com/tag/weibo/) - [Git](https://www.parallellabs.com/tag/git/) - [Tutorial](https://www.parallellabs.com/tag/tutorial/) - [Learning](https://www.parallellabs.com/tag/learning/) - [Impala](https://www.parallellabs.com/tag/impala/) - [招聘](https://www.parallellabs.com/tag/招聘/) - [scala](https://www.parallellabs.com/tag/scala/) - [SuperVessel Cloud](https://www.parallellabs.com/tag/supervessel-cloud/) - [Spark](https://www.parallellabs.com/tag/spark/) - [Docker](https://www.parallellabs.com/tag/docker/) - [OpenStack](https://www.parallellabs.com/tag/openstack/) - [创新](https://www.parallellabs.com/tag/创新/) - [创业](https://www.parallellabs.com/tag/创业/) - [业界评论](https://www.parallellabs.com/tag/review/) - [系统架构](https://www.parallellabs.com/tag/system-architecture/) - [Druid](https://www.parallellabs.com/tag/druid/) - [增长](https://www.parallellabs.com/tag/增长/) - [Growth](https://www.parallellabs.com/tag/growth/) - [entripreneur](https://www.parallellabs.com/tag/entripreneur/)