随笔分类 -  Coding Notes

Little thoughts over coding..
mysql的for update问题记录和解决方案(悲观锁一般使用方式)
摘要:本文测试时间时2020.12.06 测试的mysql版本是community版本8.0.22 首先指出一个select ...for update的一个大家很容易产生的错误理解:"for update可以锁存在的和不存在的记录,同一个索引字段的同样的值一定会block住。" 这句话对也不对。对是指它 阅读全文

posted @ 2020-12-06 18:33 三叁 阅读(2507) 评论(3) 推荐(0)

lock: mutex/spinlock/shared lock
摘要:mutex( x lock): when a mutex lock is obtained, others cannot obtain the same mutex while the lock is not freed. shared lock( s lock): when a shared lo 阅读全文

posted @ 2018-10-25 00:26 三叁 阅读(178) 评论(0) 推荐(0)

event based: libev libevent libuv
摘要:libev First let's talk about libev, it is a lib used in ss. The coding style of libev is ugly. To see man page of libev by: man ./ev.3 3 files need to 阅读全文

posted @ 2018-10-19 03:13 三叁 阅读(362) 评论(0) 推荐(0)

TCP: Nomenclatures
摘要:SACK: (selective ack), it is an option added to normal ack packets. Normally sack can specify at most 4 groups of seq_start, seq_end. Meaning bytes at 阅读全文

posted @ 2018-09-04 01:46 三叁 阅读(187) 评论(0) 推荐(0)

TCP options: Intro
摘要:According to RedHat accessories, TCP_NODELAY: each call to write(fd, buf...) will be sent out as packet. This leads to poor overall performance when m 阅读全文

posted @ 2018-08-30 20:58 三叁 阅读(133) 评论(0) 推荐(0)

Systemtap: learning notes
摘要:Before using stap, the kernel-debuginfo-$(uname -r), kernel-debuginfo-common-$(uname -m)-$(uname -r) and kernel-devel-$(uname -r) should be installed. 阅读全文

posted @ 2018-07-15 18:48 三叁 阅读(283) 评论(0) 推荐(0)

golang: impressed by its cross compiling possibilities
摘要:However till now golang's debug functionality seems far from okay. During debug you cannot print map objects. And also from debugging related aspects, 阅读全文

posted @ 2018-07-08 07:48 三叁 阅读(125) 评论(0) 推荐(0)

Crossbuild: with crosstool-ng
摘要:Before preceding, several things need to be checked: There are too many tutorials on how to build with ct-ng, I only list several useful steps for fut 阅读全文

posted @ 2018-07-04 06:35 三叁 阅读(308) 评论(0) 推荐(0)

LeetCode: fault list
摘要:1. malloc memory should always use the following form: 2. memset memory to 0 should use the form: 3. malloc(0) might also return address which is non- 阅读全文

posted @ 2018-06-02 02:09 三叁 阅读(219) 评论(0) 推荐(0)

Rule of Programming: C
摘要:My summary after reading this. Before doing large memory writes: _mm*_stream_s[i,s,d]*: non-temporal memory store: When data is produced and not (imme 阅读全文

posted @ 2018-05-24 12:04 三叁 阅读(165) 评论(0) 推荐(0)

IOCTL: usage example
摘要:ioctl is used in communication with modules of Linux. Module: User space In case of Makefile is needed: 阅读全文

posted @ 2018-05-03 17:56 三叁 阅读(530) 评论(0) 推荐(0)

GNU Autoconf: Intro
摘要:some frequently used AC macros: AC_INIT :must AC_OUTPUT :must AC_PREREQ :determine ac version so that needed features are included AC_CONFIG_SRCDIR :d 阅读全文

posted @ 2018-03-06 11:58 三叁 阅读(263) 评论(0) 推荐(0)

C: release & debug differences (might apply to all programming languages)
摘要:Sometimes we build a program as release and when debugging, some variables cannot be printed out, and displayed as optimized out. That is because the 阅读全文

posted @ 2017-12-21 20:12 三叁 阅读(172) 评论(0) 推荐(0)

PHP: Learning Notes
摘要:from here. php basics in PHP, variables are defined as $_alphanum variables should always prefixed a $ variables defined/assigned outside of a functio 阅读全文

posted @ 2017-11-24 17:57 三叁 阅读(193) 评论(0) 推荐(0)

Composer: PHP package manager
摘要:To use composer, first system must satisfy php environment: To install composer, try either: enable packagist repo globally: [its speed seems not fast 阅读全文

posted @ 2017-11-24 11:31 三叁 阅读(451) 评论(0) 推荐(0)

net-snmp: introduction
摘要:SNMP is a protocol that enables server remote-info-exchange. Which according to wikipedia: it [collecting and organizing information about managed dev 阅读全文

posted @ 2017-10-09 18:11 三叁 阅读(468) 评论(0) 推荐(0)

Maven: Usage
摘要:Maven, is actually a java project manager.. Installing maven in windows need to set system environment vars like JAVA_HOME and PATH.. And it is rather 阅读全文

posted @ 2017-03-19 21:07 三叁 阅读(300) 评论(0) 推荐(0)

OvS: Bug..
摘要:again 阅读全文

posted @ 2017-02-21 10:49 三叁 阅读(159) 评论(0) 推荐(0)

OvS: ovs-ofctl adding parameters analysis
摘要:if using dpdk, then OvS' datapath folder is ignored. Only OvS' userspace code are in use. According to manpages of ovs-vsctl/ovs-dpctl, it says that t 阅读全文

posted @ 2017-01-04 15:45 三叁 阅读(484) 评论(0) 推荐(0)

C89, C99, C11: All the specifics that I know
摘要:before anything.. sizeof is an operand! sizeof is an operand! sizeof is an operand! 重要なことは三回にしませんね! int *ptr; sizeof *ptr; = sizeof (int); the followi 阅读全文

posted @ 2016-10-28 11:53 三叁 阅读(264) 评论(0) 推荐(0)

导航