博客 / 列表

銀翼Neal - 嵌入式的json解析庫對比:cjson vs jsmn

在做物聯網應用中,需要和服務器做通信,經常使用json格式。 cjson是常用的解析庫,功能強大。 https://github.com/DaveGamble/cJSON jsmn利用了零拷貝,減少了內存的使用,適合小資源嵌入式系統。 https://github.com/zserge/jsmn 下面直接從使用角度進行對比: 解析 cjson:開箱即用 cJSON*j

嵌入式 , 物聯網 , Json

銀翼Neal - linux中kfifo的無鎖隊列實現解讀

簡介 kfifo是linux內核中的一個模塊。 在單消費者,單生產者情況下,可以達到不加鎖也能保證線程安全的效果。 路徑 linux/lib/kfifo.c,鏈接直達:https://github.com/torvalds/linux/blob/master/lib/kfifo.c linux/include/linux/kfifo.h,鏈接直達:https://github.com/

嵌入式 , linux-kernel