Is it efficient to create many tasks? 创建许多任务是否有效?
Previously I talked about the concept of thread explosion, which is when you create many more threads than CPU cores and the system struggles to manage them effectively. Howev...
Important: Do not use an actor for your SwiftUI data models 重要提示:请勿将角色用于 SwiftUI 数据模型
Swift’s actors allow us to share data in multiple parts of our app without causing problems with concurrency, because they automatically ensure two pieces of code cannot...
How to handle concurrency errors in unit tests 如何处理单元测试中的并发错误
Both Swift Testing and XCTest give us three main options for handling errors in tests: we can consider them immediate failures, we can handle them internally and make our own asser...
How to force concurrent tests to run on a specific actor 如何强制并发测试在特定actor上运行
Swift Testing and XCTest behave differently when it comes to running tests in parallel: unless you say otherwise, Swift Testing will run both synchronous and asynchronous tests on ...
Docker 基础 – 容器
容器常见命令创建容器# 完整命令 docker container run <image name> # 简写命令 docker run <image name> 列出容器查看 up 状态的容器# 完整命令 docker container ls # 简写命令 ...
macOS Python 多版本管理
安装 Homebrew Homebrew 的官网 https://brew.sh/ 在终端输入以下命令进行安装 /bin/bash -c '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)' 安装完成后...
Day 7 – 猜单词游戏
猜单词游戏的基本业务流程如下所示 生成单词,检测答案 生成随机单词,并检测用户输入的单词是否在选定的单词中 import random word_list = ['aardvark', 'baboon', 'camel'] chosen_word = ran...