forked from LinkedDestiny/swoole-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhanglei5
committed
Dec 4, 2014
1 parent
6082fd9
commit e234428
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 13. swoole_table | ||
|
||
swoole_table是一个基于共享内存和锁实现的超高性能,并发数据结构。用于解决多进程/多线程数据共享和同步加锁问题。 使用swoole_table可以方便的共享数据,而不用担心数据同步问题,不需要用户层加锁,不需要考虑锁的开销。 | ||
swoole_table使用行锁,而不是全局锁,仅当2个进程在同一CPU时间,并发读取同一行数据才会进行发生抢锁。 | ||
|
||
> swoole_table在1.7.5版本后可用<br> | ||
swoole_table-0.1版本,单进程压测每秒可读写50W次左右<br> | ||
## 常量列表 | ||
swoole_table 目前只支持以下3种类型,个人感觉有点儿类似于表字段类型。 | ||
* swoole_table::TYPE_INT 整形字段 | ||
* swoole_table::TYPE_FLOAT 浮点字段 | ||
* swoole_table::TYPE_STRING 字符串字段 | ||
|
||
## 函数列表 | ||
|
||
- [__construct](#swoole_table__construct) |