Comments (9)
可以用,blob KV API,如 fdb_kv_set_blob API
from flashdb.
可以用,blob KV API,如 fdb_kv_set_blob API
fdb_kv_set_blob调用了set_kv,set_kv里面使用了static变量kv和sector,就是不可重入的。
from flashdb.
fdb_kv_set_blob 里有 lock
from flashdb.
fdb_kv_set_blob 里有 lock
lock的设计意图是避免多个进程访问同一个kvdb实例产生冲突,但是现在不同的进程访问不同的kvdb实例,仍可能在static变量上产生冲突,所以即使是不同的实例,也要加全局锁。
from flashdb.
明白你的意思了,可以移除掉 set_kv/del_kv 中的 static 修饰,方便提交一个 PR 改进下吗
from flashdb.
我这边修改比较简单,就直接说了吧:
- del_kv()里用到的last_is_complete_del,把last_is_complete_del放在struct fdb_tsdb结构体里,通过db->last_is_complete_del引用;
- set_kv()里的kv和sector变量,去掉static修饰,直接定义在栈上,会稍微多消耗一些栈空间
from flashdb.
我这边修改比较简单,就直接说了吧:
- del_kv()里用到的last_is_complete_del,把last_is_complete_del放在struct fdb_tsdb结构体里,通过db->last_is_complete_del引用;
- set_kv()里的kv和sector变量,去掉static修饰,直接定义在栈上,会稍微多消耗一些栈空间
完全可以的,可以尝试提交一下 PR 吗
from flashdb.
fdb_kv_get()这个函数不可重入,并且没法读取汉字字符串。因为加了ascii判断
from flashdb.
fixed in b3041a1
from flashdb.
Related Issues (20)
- FlashDB怎样删除数据记录?
- 通过fdb_kvdb_control参数而不是宏,控制kv_auto_update HOT 1
- 移植后norlfash的默认配置参数无法写入成功,请问下可能是什么原因? HOT 1
- Question: any reason to check that new entry timestamp is newer than previous? HOT 4
- 关于默认参数表写入超过48字节的字符型kv引发的问题 HOT 3
- 现有迭代器函数很难覆盖更多应用,一些新迭代器函数的实现探讨 HOT 1
- flashdb日志写满判断 HOT 2
- fal_flash_stm32f4.c中stm32_get_sector函数中的Address是否应替换为addr
- 关于TSDB存满之后的问题,望作者大大解答呀
- FlashDB取消了IAP功能吗 HOT 1
- 2.1版本初始化KVDB时重复上锁 HOT 5
- FlashDB 中tsdb如何实现log存储,需要用easylogger配合吗?
- [FlashDB][tsl][log] Error: this TSL (0x004002E8) size (724249387) is out of bound.remain = 3972857
- 出现crc32 failed, 测试程序boot_count总是读取失败, 但是测试程序temp的read/write是正常的 HOT 2
- KVDB在写满后再次写入失败,需要写入第二次 HOT 1
- 请教 KVDB 掉电异常后的恢复方法
- 测试tsdb连续保存累计数达一定数量后出现前面部分数据丢失的现象 HOT 2
- 用文件作为存储后端,有锁首次初始化时,_fdb_kv_load 中调用 fdb_kv_set_default 死锁 HOT 2
- 老化擦写Flash的KV后,读取一个不存在的KV或者写一个不存在的KV,Flash耗时长
- check the current timestamp, MUST more than the last save timestamp HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashdb.