• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Export Word
    • Attachments
    • Page Information

    Loading...
  1. Dashboard
  2. Loom
  3. Main

Page History

Versions Compared

Old Version 16

changes.mady.by.user Ron Pressler

Saved on Aug 03, 2018

compared with

New Version 17

changes.mady.by.user Ron Pressler

Saved on Aug 03, 2018

  • Previous Change: Difference between versions 15 and 16
  • Next Change: Difference between versions 17 and 18
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Loom

 Fibers, Continuations and Tail-Calls

Welcome to the Loom Project!

The goal of this Project is to explore and incubate Java VM features and APIs built on top of them for the implementation of lightweight user-mode threads (fibers), delimited continuations, and related features, such as explicit tail-calls.

This OpenJDK project is sponsored by the HotSpot Group.

 

Info
titleSource Code

http://hg.openjdk.java.net/loom/loom/

Info
titleTalks

JVMLS 2018 – Video

JFokus 2018 – Video

Info
titleMailing List

Subscribe | Archive

Info
titleProject

Proposal | JEP | Members | Page

 

 

Warning
titleNote

Loom is under active development, which means that information and advice given here might change in the future.

 

Table of Contents

Supported Platforms

 

Mac and Linux on x86-64

Download and Build from Source

 

Code Block
$ hg clone http://hg.openjdk.java.net/loom/loom  
$ cd loom  
$ hg update -r fibers 
$ sh configure   
$ make images

(Note that you must switch to the fibers branch  branch before building)

Missing Features

  • JVM TI support (fiber debugging)

  • Forced preemption

  • Cloning continuations
  • Serialization of fiber/continuation

     

Continuations

Design

The primitive continuation construct is that of a scoped (AKA multiple-named-prompt), stackful, one-shot (non-reentrant) delimited continuation. The continuation can be cloned, and thus used to implement reentrant delimited continuations.

Implementation

Performance

Current yield/continue performance is far from stellar. The reason is that we focused on getting a working prototype using existing Hotspot mechanisms, some of which have not been designed to be used so frequently. We are now working on improving performance both by optimizing the actual freeze/thaw logic, as well as optimizing those existing VM mechanisms. 

One mechanism that is particularly slow is the one used to detect whether a frame is holding a native monitor (synchronized block). Because this mechanism is so slow, the monitor detection can be turned off (which will break fiber code that runs through synchronized blocks) by adding `-XX:-DetectLocksInCompiledFrames` to DetectLocksInCompiledFrames to the java command  command line.

An important performance feature is lazy-copying of frames. This feature is currently turned off by default because it is missing some important functionality, in particular it does not support the throwing of exceptions, and stack traces will miss some frames (those that have not been thawed). To turn lazy copying on, add `-XX:+UnlockExperimentalVMOptions -XX:+UseNewCode` to UseNewCode to the java command  command line.

Fibers

Design

Implementation

Fibers are implemented in the core libraries. A fiber is implemented as a continuation (of fiber scope) that is wrapped as a task and scheduled by a j.u.c.Executor.

Tail Calls

Design

 

 

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 243, "requestCorrelationId": "91ad559b43bf2bb1"}