SPVM::D...:System(3)
๐ Name ๐
Bestie, welcome to SPVM::Document::Language::System(3) โ the System Setting in the SPVM Language page from the User Contributed Perl Documentation. This is the manual page for system settings in the SPVM language, and we're about to make it make sense. ๐
โจ
๐ธ Description ๐ธ
This document describes system setting in the SPVM language. That's the whole description, bestie โ short and sweet, but the rest of the page is where the details live. ๐ซถ
๐ฆ System Setting ๐ฆ
Okay so here's the system setting section. Buckle up. ๐
๐ Standard Streams ๐
SPVM opens its own standard input, standard output, and standard error for a runtime just after a runtime is built. Fresh runtime, fresh streams, no cap. โจ
Their open modes are set to binary mode (https://learn.microsoft.com/en-us/cpp/c-runtime-library/text-and-binary-mode-file-i-o?view=msvc-170) on Windows. Yes, that's the exact link. ๐ช
Then the operators do their thing:
printoperator โ outputs to this SPVM's standard output. ๐sayoperator โ outputs to this SPVM's standard output. Same energy, still iconic. ๐warnoperator โ outputs to this SPVM's standard error. โ ๏ธ
๐งต Thread Safety ๐งต
The SPVM language has some thread-safe features. Not every feature, but some โ and here's the breakdown. ๐
๐ฅ Runtime Stack ๐ฅ
When a new thread is created โ such as an OS native thread โ or a coroutine such as a goroutine is created, a new runtime stack should be created for the new thread. The exact line is:
SPVM_VALUE* new_stack = env->new_stack(env);
This runtime stack has thread-specific data, such as the value of the exception variable, as well as method-specific data, such as arguments and a return value. Very "main character with her own storage" of it. ๐
When the new thread finished, the new runtime stack must be released. Like, for real, release it:
env->free_stack(env, new_stack);
Currently, user data cannot be got and set in a runtime stack. That's just the situation. ๐
If thread-specific user data is needed, the thread ID is got by the Thread#get_id method, and this thread ID can be a key of a hash for thread-specific user data. In this case, the Hash class is not thread safe, so a lock using a mutex is needed. Lowkey crucial, bestie. ๐
โ๏ธ Atomic Operations โ๏ธ
This section describes atomic operations. ๐ฅ
Generally speaking, when using OS native threads with SPVM, the following atomic operations can result in severe performance degradation. Severe performance degradation. So the advice is to minimize object creations and object assignments in newly created OS native threads. Big "keep it light" energy. ๐
Coroutine threads such as goroutines don't have to worry about things like this because these are synchronized. Slay for synchronized coroutines. ๐ง
๐งฎ Updating Memory Blocks Count ๐งฎ
Updating the count of allocated memory blocks is an atomic operation and thread safe. It is protected by a mutex. ๐
The count of all allocated memory blocks in a runtime is managed and is got by get_memory_blocks_count native API. That's the exact native API name, iykyk. ๐
๐๏ธ Updating Runtime Cache ๐๏ธ
Updating a runtime cache data is an atomic operation and thread safe. It is protected by a mutex. ๐
๐ ๏ธ Compilation ๐ ๏ธ
A compilation is an atomic operation and thread safe. It is protected by a mutex. Periodt. โจ
๐ข Updating Reference Count ๐ข
Updating the reference count of an object is an atomic operation and thread safe. It is protected by a mutex. Keep that reference count safe, bestie. ๐
๐ See Also ๐
Go peek at these, no cap:
SPVM::Document::Language::OperatorsSPVM::Document::LanguageSPVM::Document
๐ Copyright & License ๐
Copyright (c) 2023 Yuki Kimoto
MIT License
That's the copyright and license info, exactly as it appears. ๐
And that's the whole page! It comes from perl v5.42.2, dated 2026-02-03 โ cute little footer sign-off delivered with a bow. ๐โจ
๐ฆ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms