当前位置:网站首页>Swoole内存-table详解
Swoole内存-table详解
2022-07-27 22:38:00 【生命不止、战斗不息】
内存操作模块
Lock Buffer Table Atomic mmap channel serialize
介绍
swooletable是一个基于共享内存和锁实现的超高性能,并发数据结构
优势
- 性能强悍,单线程每秒可读写200万次
- 应用代码无需加锁,Table内置行锁自旋锁,所有操作均是多线程/多进程安全。用户层完全不需要考虑数据同步问题;
- 支持多进程,Table可以用于多进程之间共享数据
- 使用行锁,而不是全局锁,仅当2个进程在同一cpu时间,并发读取同一条数据才会进行发生抢锁
table.php
<?php
//创建内存表
$table = new \Swoole\Table(1024);
//内存表增加一列
$table->column('id', $table::TYPE_INT,4);
$table->column('name', $table::TYPE_STRING,64);
$table->column('age', $table::TYPE_INT,3);
$table->create();
$table->set('wyt',['id'=>1,'name'=>'wyt','age'=>18]);
print_r($table->get('wyt'));结果
自增
$table->incr('wyt','age',2);自减
$table->decr('wyt','age',2);边栏推荐
- 110. In depth introduction to sap ui5 fileuploader control - why do you need a hidden iframe
- Programmer growth Chapter 30: do you really understand feedback?
- Add a picture in front of the cell
- 字节飞书人力资源套件三面
- At least 42 employees are infected with novel coronavirus! Nokia announces closure of telecom equipment plant in India
- Jerry, if you turn on Bluetooth again, one for two. When the mobile phone is connected to the prototype, it will appear and cannot be connected [chapter]
- How to clearly understand and express IAAs, PAAS and SaaS?
- 深度刨析数据在内存中的存储
- Red team killer behinder_ V4.0 (ice scorpion 4.0)
- Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]
猜你喜欢

网络安全漏洞分析与漏洞复现

接口测试实战项目02:读懂接口测试文档,上手操练

Recommend a Hongmeng instant messaging software "fruit chat", which is a bit awesome!!

What is the org relationship mitigation strategy of Microsoft edge browser tracking prevention
![[300 opencv routines] 241. Scale invariant feature transformation (SIFT)](/img/7a/a764c779c3162920c832325f89f340.png)
[300 opencv routines] 241. Scale invariant feature transformation (SIFT)

From the second floor to the third floor

Storage of deep planing data in memory

Ink wheel salon | Li Wenjie, Peking University: a graph database system for knowledge atlas application gstore

融云 IM & RTC 能力上新盘点

KMP review + AC automata Prequel
随机推荐
Leetcode:1997. the first day after visiting all rooms [jump DP]
Red team killer behinder_ V4.0 (ice scorpion 4.0)
Interface test practical project 02: read interface test documents and practice
小波变换学习笔记
Recommended system - indicators: CTR, CVR
Jerry's prompt sound processing when switching devices [chapter]
Vandermond convolution learning notes
Data visualization - White Snake 2: black snake robbery (3)
Valued at $36billion! SpaceX, which is about to launch its first manned launch, raised $346million
推荐系统-模型:wide&deep 模型
[introduction to C language] zzulioj 1026-1030
Count the six weapons of the domestic interface cooperation platform!
Focus on demand flow rather than idle people
Leetcode - find the median of two positively ordered arrays
Syntaxerror resolved: positive argument follows keyword argument
[BuildRelease Management]Parabuild
scrollview、tableView嵌套解决方案
网络设备硬核技术内幕 防火墙与安全网关篇 (十)
[original] [crawler series] briefly get the most popular topics, related topics and description information
如果某个表有近千万数据,CRUD比较慢,如何优化