Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
IT Security NachrichtenBetrüger phishen mit vermeintlicher Reisebestätigung - IT-Markt(24.09.2026 um 23:41 Uhr)
••
Sicherheitslücken (CVE)IT Security News Daily Summary 2026-09-24(24.09.2026 um 23:55 Uhr)
•
Sicherheitslücken (CVE)IT Security News Roundup: 2026-09-24(24.09.2026 um 23:57 Uhr)
•
Sicherheitslücken (CVE)IT Security News Hourly Summary 2026-09-25 00h : 9 posts(25.09.2026 um 00:00 Uhr)
•••
IT NachrichtenMicrosoft puts Brad Smith in charge of communications(25.09.2026 um 00:08 Uhr)
•••
IT Security NachrichtenBetrüger phishen mit vermeintlicher Reisebestätigung - IT-Markt(24.09.2026 um 23:41 Uhr)
••
Sicherheitslücken (CVE)IT Security News Daily Summary 2026-09-24(24.09.2026 um 23:55 Uhr)
•
Sicherheitslücken (CVE)IT Security News Roundup: 2026-09-24(24.09.2026 um 23:57 Uhr)
•
Sicherheitslücken (CVE)IT Security News Hourly Summary 2026-09-25 00h : 9 posts(25.09.2026 um 00:00 Uhr)
•••
IT NachrichtenMicrosoft puts Brad Smith in charge of communications(25.09.2026 um 00:08 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Easily handle concurrency: Concurrency programming model of Cangjie language under HarmonyOS Next

In scenarios such as smart terminals, Internet of Things, edge computing, etc., concurrency capabilities have become a key element of modern application development.Especially in a new ecosystem of HarmonyOS Next, which emphasizes…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

In scenarios such as smart terminals, Internet of Things, edge computing, etc., concurrency capabilities have become a key element of modern application development.Especially in a new ecosystem of HarmonyOS Next, which emphasizes multi-device collaboration and real-time response, how to write secure and scalable concurrent programs in a simple and efficient way has become an important challenge for developers.



Fortunately, Cangjie has created an elegant and efficient model for concurrent programming, which significantly reduces the difficulty of development.As an engineer who has been involved in the HarmonyOS Next project for a long time, I will combine practical operations to take you into the depth of the power of Cangjie's concurrency model.






Lightweight user-state threads: the basis of efficient concurrency



Cangjie Language abandons the heavyweight design of traditional system threads and adopts lightweight user-mode threads (User - Mode Threads), which have the following characteristics:





  • Extremely lightweight: Each thread requires very few resources, much smaller than the system thread.


  • User state management: The creation, scheduling and destruction of threads are controlled by Cangjie's runtime.


  • Shared memory space: Data can be shared between threads for easy communication.


  • Compatible with traditional API: The usage method is consistent with system threads, easy to get started.






Why choose a user-state thread?



There are many problems with traditional system threads (such as Pthread):




  • Creation and destruction cost a lot.

  • Context switching is expensive when scheduling.

  • There are limits on the number of threads, usually only a few thousand are created.



Cangjie's user-state threading has obvious advantages:




  • Create only takes tens of bytes of memory and a few microseconds.

  • Easily manage tens of thousands of threads on a stand-alone basis.

  • Scheduling is completed at the language layer, fast and controllable.






Example: Start multiple Cangjie threads






import runtime.thread

main() {
for (let i in 0..10) {
thread.start {
println("Hello from thread ${i}")
}
}
}






The output is similar:




Hello from thread 0
Hello from thread 1
Hello from thread 2
...








  • thread.start is used to start a new lightweight thread.

  • Anonymous code block is the thread execution body.

  • The writing experience is similar to ordinary function calls, which is simple and convenient.






Concurrent Object Library: Thread Safety has never been easier



In traditional concurrent programming, data race and deadlock are difficult problems.Cangjie greatly reduces the burden on developers to handle concurrency through the built-in Concurrent Object Library. The specific mechanism is as follows:





  • Concurrent Object: Internal methods automatically achieve thread safety, and developers do not need to manually add locks.


  • Lock-free/fine-grained lock: Some core libraries adopt lock-free design, pursuing ultimate performance.


  • Consistent API Experience: Concurrent calls and serial calls are written exactly the same.






Example: Using thread-safe concurrent objects





```import runtime.concurrent



mut class Counter {

private var count = 0




public func inc(): Unit {
count += 1
}

public func get(): Int {
return count
}




}



main() {

let counter = concurrent(Counter())




for (let i in 0..1000) {
thread.start {
counter.inc()
}
}

sleep(1 * Duration.Second)
println("Final count: ${counter.get()}")




}






- `concurrent(obj)` converts normal objects into thread-safe objects.
- There is no need to manually add locks when calling `inc()` in concurrently.
- `sleep` is used to ensure that all threads have completed execution.

Practical experience: In the past, when writing concurrent logic, you had to carefully manage locks. Now, with the help of the concurrent object library, you can perform concurrent operations almost without burden, greatly improving the development speed and code accuracy.

## Lock-free and fine-grained locks: protect the ultimate performance
Although the default concurrent object can meet most scenarios, the overhead of locks cannot be ignored in some scenarios with extremely high performance requirements (such as high-frequency trading, real-time sensor processing).To this end, Cangjie's concurrency library uses the **Lock-Free or Fine-grained Lock technology for some core structures (such as lock-free queues and CAS variables). Their respective advantages are as follows:
- **Lock-Free**: Avoid thread blocking and improve system throughput capabilities.
- **Fine-grained lock**: Reduce lock competition and improve the degree of concurrent processing.
- **Spinlock**: Suitable for scenes with high frequency operations in a short time.

### Practical Examples (from Cangjie Standard Library)


```import runtime.concurrent

let queue = concurrent.Queue()

thread.start {
for (let i in 0..100) {
queue.enqueue(i)
}
}

thread.start {
for (let i in 0..100) {
if (queue.dequeue() != null) {
println("Got item")
}
}
}







  • Queue is implemented internally with lock-free algorithm, with excellent performance.

  • Suitable for producers with high concurrency - consumer scenarios.






A summary of the concurrency characteristics of Cangjie




























Properties Description Practical Meaning
User-state threads Lightweight, efficient, support massive threads Implement fast response and high concurrency processing
Concurrent object library Automatic thread-safe encapsulation Simplify development process and reduce code vulnerabilities
Lock-free/fine-grained lock optimization Implement high-performance concurrent processing Meet extreme performance requirements scenarios





Summary



Cangjie achieved an excellent balance in concurrent design:





  • Simple and easy to use: Newbie can easily write the correct concurrent program.


  • Extreme Performance: Advanced users can perform deep tuning to give full play to their hardware performance.


  • Safe and reliable: Effectively avoids most common concurrency problems.



I personally admire Cangjie's design style that is concurrency friendly and has good control.This efficient concurrency capability is crucial when developing HarmonyOS Next multi-device collaborative applications.With the continuous enrichment of the ecosystem, I believe that Cangjie's concurrent programming capabilities will play a key role in more complex projects.

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Easily handle concurrency: Concurrency programming model of Cangjie language under HarmonyOS Next
id: 9b39dadb-6276-411b-8430-5e483f01d0de
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "Easily handle concurrency: Con" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Easily handle concurrency Concurrency pr")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Easily handle concurrency Concurrency pr*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Easily handle concurrency Concurrency pr"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Easily handle concurrency: Concurrency p.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Easily handle concurrency: Concurrency programming model of Cangjie language under HarmonyOS Next

Thematisch verwandte Begriffe: Easily, handle, concurrency, Concurrency · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-87722 | Uncontrolled Resource Consumption (CWE-400 / CWE-1333) in regex search q…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle