Ruby creator floats new concurrency model

Developers using the open source Ruby dynamic language are in for some big changes. The language is set to feature a new concurrency and parallelism model, called Guild, in the Ruby 3 upgrade tentatively slated to arrive before 2020.

Plans detailed at a technical conference in Kyoto, Japan this week cite intentions to equip Ruby for a programming landscape that increasingly has moved to multi-core processing. Currently, Ruby supports concurrency via threads, but making thread-safe programs is hard because of a need to manage object mutations. Guild overcomes this issue via a concurrency model enabling parallel execution.

"Since threads provide no data protection, it is very difficult to write correct programs," Ruby founder Yukihiro Matsumoto said. "Guilds are isolated [from] each other and do not share mutable states, basically like an actor model that many other languages have." Ruby needs a new concurrency model because it already has a thread model that cannot be removed, as it maintains compatibility in the language, Matsumoto said.

The conference presentation from Heroku's Koichi Sasada, a Ruby core committer, maps out intentions for Guild, described as a "new concurrency abstraction." Each Guild has at least one thread; threads in different Guilds can run in parallel, but threads in the same guild can't because of a Giant Guild Lock capability. Mutable objects should belong to one Guild, but there can be communication between Guilds.

Multi-threaded programming is difficult, with risks including race conditions among threads, Sasada noted. There can be trade-offs in performance versus safety, it's difficult to tune performance, mutable objects must be shared correctly, and debugging is difficult.

"Guild is part of our Ruby 3 experiment," Matsumoto said, but he also noted that the name, Guild, as well as its behavior could be changed by the time it arrives.

IDG Insider


« 9 reasons why PC gaming is a better value than consoles


Why iPhone 7 might be a better fit for enterprise than consumers »
IDG Connect

IDG Connect tackles the tech stories that matter to you

  • Mail

Recommended for You

20 Red-Hot, Pre-IPO companies to watch in 2019 B2B tech - Part 1

Martin Veitch's inside track on today’s tech trends

Training and certification for a cloud native world

Keri Allan looks at the latest trends and technologies

Unicorns are running free in the UK but Brexit poses a tough challenge

Trevor Clawson on the outlook for UK Tech startups


Do you think your smartphone is making you a workaholic?