Parallelization of dynamic languages: synchronizing built-in collections

Parallelization of dynamic languages: synchronizing built-in collections
复制标题

动态语言的并行化:同步内置集合

DOI:
--
复制
发表时间:
2018
期刊:
Proc. ACM Program. Lang.
影响因子:
--
通讯作者:
E. Petrank
E. Petrank
中科院分区:
--
文献类型:
--
作者:
Benoit Daloze;A. Tal;Stefan Marr;H. Mössenböck;E. Petrank

文献摘要

参考文献

被引文献

相似文献

像Python和Ruby这样的动态编程语言被广泛使用,为了提高它们的效率,人们付出了很多努力。在这个方向上的一项重要研究工作是使并行代码执行成为可能。虽然已经取得了重大进展,但使动态集合高效、可伸缩和线程安全仍然是一个有待解决的问题。动态语言中的典型程序使用很少但通用的集合类型。这样的集合是动态环境的重要组成部分,但很难做到安全、高效和可伸缩。在本文中,我们根据每个集合实例的动态需求,提出了一种通过逐步增加同步级别来实现高效并发集合的方法。只能由单个线程访问的集合没有同步,在边界内访问的数组具有最小的同步,对于一般情况,我们采用布局锁范式,并使用适合动态语言设置的轻量级版本扩展其设计。我们将这种方法应用于Ruby的数组和哈希集合。我们的实验表明,我们的方法在单线程基准测试上没有开销,在数组和哈希访问上线性扩展,在经典并行算法上实现与Fortran和Java相同的可扩展性,并且在Ruby工作负载上比其他Ruby实现的可扩展性更好。
Dynamic programming languages such as Python and Ruby are widely used, and much effort is spent on making them efficient. One substantial research effort in this direction is the enabling of parallel code execution. While there has been significant progress, making dynamic collections efficient, scalable, and thread-safe is an open issue. Typical programs in dynamic languages use few but versatile collection types. Such collections are an important ingredient of dynamic environments, but are difficult to make safe, efficient, and scalable. In this paper, we propose an approach for efficient and concurrent collections by gradually increasing synchronization levels according to the dynamic needs of each collection instance. Collections reachable only by a single thread have no synchronization, arrays accessed in bounds have minimal synchronization, and for the general case, we adopt the Layout Lock paradigm and extend its design with a lightweight version that fits the setting of dynamic languages. We apply our approach to Ruby's Array and Hash collections. Our experiments show that our approach has no overhead on single-threaded benchmarks, scales linearly for Array and Hash accesses, achieves the same scalability as Fortran and Java for classic parallel algorithms, and scales better than other Ruby implementations on Ruby workloads.
DOI: 10.1145/2754169.2754187
发表时间: 2015-06
期刊: Proceedings of the 2015 International Symposium on Memory Management
影响因子: --
作者:
Yi Lin;Kunshan Wang;S. Blackburn;Antony Hosking;Michael Norrish
通讯作者: Yi Lin;Kunshan Wang;S. Blackburn;Antony Hosking;Michael Norrish