Java21 - 虚拟线程
就了解一下 对于刚接触虚拟线程的人来说,其普遍被认为是一种“轻量级线程,可以提高开发效率?” 。他的强大的点就是,在发生堵塞的时候可以自动暂停和恢复,从底层系统中解放这个线程,让这个线程可以去干别的事情。 虚拟线程并非1:1的和一个专门的OS级别线程对应,观看线程池任务,可以看出当虚拟线程进入堵塞的
JVM - 取消字段final/修改final字段
class Main {
private const val METHOD_MH_ACCESSOR = 0x1
private var UNSAFE: Unsafe? = null
init {
var unsafe: Unsafe? = null
try
Kotlin Flow Test
Start Code suspend fun main(args : Array<String>){
val flow = MutableSharedFlow<Int>()
GlobalScope.launch {
flow.collect {
Comparison performance testing between Pbandk and Kotlinx Protobuf
Introduction This article is a comparison of the performance of the serialization and deserialization of the same data using the Pbandk library and th
Kotlin - 泛型?还是泛型?
kotlin的泛型有in, out, where 。 概念 其中有3个概念,分别是协变,逆变,不变。 不变 我们这里有一段代码: class Box<T>(val value: T)
suspend fun main() {
val stringBox: Box<String> = Box