ASCI Logo
ASCI.Academy
LearnPracticeCompeteCareer
Sign InGet Started

Search ASCI Academy

Universal search across Courses, Lessons, Skills, Projects, Challenges, Competitions, Jobs, Internships, and Users

java advanced

Curriculum Index

Current LevelInitiate
0/ 500 XP
Gravit Certificate:
100% Required
  • 1.1 Platform Threads vs Virtual Threads
•
1
2
3
4
5
6
7
8
9
10
Module 1: Concurrency & Virtual Threads (Project Loom)•Lesson 1

1.1 Platform Threads vs Virtual Threads

### High-Throughput Concurrency
Traditional platform threads wrap OS threads, each consuming ~1MB of memory and limited to thousands per machine. Java 21 **Virtual Threads** are lightweight user-mode threads managed directly by the JVM, enabling 1,000,000+ concurrent tasks.

Main.javaJava 15
Runnable task = () -> System.out.println("CONCURRENT_OK");
Thread.startVirtualThread(task);
Java 15
•
Interactive Challenge
+90 XP
Challenge Objective

Start the concurrent task, await completion, and print 'THREAD_EXECUTED'.

solution.java
UTF-84 SpacesAuto-saved
openjdk-vm:~/workspace
CPython 3.11.8 (WASM)
$javac Main.java && java Main
Click "Compile & Run" (or press Ctrl + Enter) to compile AST, verify bytecode, and execute the solution.