摘要: Python 全局解释器锁 (GIL) 详细解析 什么是 GIL? 全局解释器锁(Global Interpreter Lock,简称 GIL)是 Python 解释器(主要是 CPython)中的一个互斥锁,它确保在任何时刻只有一个线程能够执行 Python 字节码。这个机制存在于 CPython 阅读全文
posted @ 2026-01-19 17:50 染指未来 阅读(73) 评论(0) 推荐(0)
摘要: 本文总结了 Python 3.5 到 3.14 各版本的主要语言特性和改进。 Python 3.5 (2015年9月) 主要特性 类型提示 (Type Hints) def greeting(name: str) -> str: return 'Hello ' + name PEP 492 - 异步 阅读全文
posted @ 2026-01-19 17:23 染指未来 阅读(283) 评论(2) 推荐(0)
摘要: Gin 中间件 定义中间件 中间件必须是一个gin.HandlerFunc类型。 package main import ( "fmt" "github.com/gin-gonic/gin" "time" ) // 计时中间件 func Timer1() gin.HandlerFunc { retu 阅读全文
posted @ 2025-11-17 18:09 染指未来 阅读(55) 评论(0) 推荐(0)
摘要: 重定向 路由重定向 package main import ( "github.com/gin-gonic/gin" "net/http" ) func main() { router := gin.Default() router.GET("/redirect", func(c *gin.Cont 阅读全文
posted @ 2025-11-17 18:01 染指未来 阅读(21) 评论(0) 推荐(0)
摘要: GIN参数获取 query 参数 // 1. DefaultQuery 获取不到地址栏参数,设置默认值 username:=c.DefaultQuery("username","zhangsan") // 2. Query 获取地址栏参数 address := c.Query("address") 阅读全文
posted @ 2025-11-17 18:00 染指未来 阅读(22) 评论(0) 推荐(0)
摘要: go 模版渲染 templates模板 创建一个templates模板目录 # 创建模板目录 mkdir templates # 在 templates 创建 index.html 文件 <!--index.html--> <!DOCTYPE html> <html lang="en"> <head 阅读全文
posted @ 2025-11-17 17:58 染指未来 阅读(17) 评论(0) 推荐(0)
摘要: 安装与使用 安装 go get -u github.com/gin-gonic/gin 示例 package main import ( "net/http" "github.com/gin-gonic/gin" ) func main() { // 创建一个默认的路由引擎 r := gin.Def 阅读全文
posted @ 2025-11-17 17:56 染指未来 阅读(14) 评论(0) 推荐(0)
摘要: SaltStack 集群安装指南 1. 环境准备 确保所有5台Ubuntu服务器(1台master,4台minion)满足以下条件: Ubuntu 20.04 LTS 或更高版本 网络互通,主机名解析正常 root权限或sudo权限 2. 主机名和IP规划 假设您的服务器规划如下: Master: 阅读全文
posted @ 2025-10-16 11:52 染指未来 阅读(51) 评论(0) 推荐(0)
摘要: Gitlab Runner 学习 Runner 就是一个任务的执行器 runner下载|安装|启动 下载 # 为您的系统下载二进制文件 sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads 阅读全文
posted @ 2025-10-07 13:52 染指未来 阅读(19) 评论(0) 推荐(0)
摘要: ProcessPoolExecutor VS ThreadPoolExecutor 进程池对比线程池 示例一: I/O 场景——10 个网页并发下载 + 实时进度 结果 多线程: 100%|██████████| 10/10 [00:07<00:00, 1.41it/s] 【多线程】I/O 并发总耗 阅读全文
posted @ 2025-09-22 16:20 染指未来 阅读(24) 评论(0) 推荐(0)