Microgoogle

C语言标准库常用函数

sizeof(array)以及输出十六进制int i[10] = {2, 3,4, 5,0};printf(, sizeof(i));

XADD(80486+)

.global xadd_func /* wrapper function of the xadd instruction */xadd_func:movl 8(%esp), %eax /* Save the second parameter in eax */movl 4(%esp), %ecx /* Save the first parameter in ecx */xadd %eax, (%ecx) /* Exchange and add */ret

Interrupt

When an interrupt is sent by the PIC, the PIC will not send another interrupt from that same source until it gets acknowledged through an I/O port. This is because interrupt handlers usually manipulate critical data structures and would not withstand being interrupted by new invocations of themselves (i.e. they are not reentrant). In particular, an interrupt handler must never block on anything. Most interrupt handlers simply make a note of work that must be done as a result of the interrupt, clear the interrupt, then terminate, leaving the work to be done at a more convenient time. Note that it may be possible for one interrupt handler to be interrupted by a different interrupt handler, so long as they do not share data structures.

Interrupt handler在执行前,香港服务器租用,会保存之前系统状态,执行完后,会恢复之前的状态。当一个interrupt handler A被interrupt handler B 打断以后,B执行完以后,香港虚拟主机,A就继续执行,只有当handler执行完以后,才会执行之前的被打断的user-level instruction.

tar命令不包含某个文件进行压缩

tar cvzf data.tar.gz –exclude=/data/web/aaa –exclude=/data/web/bbb /data/web/另一种方法,香港虚拟主机,先建立一个文件excludefile,里面写好/data/web/aaa/data/web/bbb然后tar命令这样:tar cvzf data.tar.gz –exclude-from /data/excludefile /data/web/

Re-entrant & Interrput handler & Thread-safe

malloc and printf usually use global structures, and employ lock-based synchronization internally. That’s why they’re not reentrant.The malloc function could either be thread-safe or thread-unsafe. Both are not reentrant:Any thread-unsafe function is not reentrant (reentrant functions are thread-safe by definition). Malloc operates on a global heap, and it’s possible that two different invocations of malloc that happen at the same time, return the same memory block. (The 2nd malloc call should happen before an address of the chunkis fetched, but the chunk is not marked as unavailable). This violates the postcondition of malloc, so this implementation would not be re-entrant.To prevent this effect, a thread-safe implementation of malloc would use lock-based synchronization. However, if malloc is called from signal handler, the following situation may happen:malloc();//initial call lock(memory_lock); //acquire lock inside malloc implementationsignal_handler(); //interrupt and process signalmalloc();//call malloc() inside signal handler lock(memory_lock); //try to acquire lock in malloc implementation // DEADLOCK! We wait for release of memory_lock, but// it won’t be released because the original malloc call is interruptedThis situation won’t happen when malloc is simply called from different threads. Indeed, the reentrancy concept goes beyond thread-safety and also requires functions to work properly even if one of its invocation never terminates. That’s basically the reasoning why any function with locks would be not re-entrant.The printf function also operated on global data. Any output stream usually employs a global buffer attached to the resource data are sent to (a buffer for terminal, or for a file). The print process is usually a sequence of copying data to buffer and flushing the buffer afterwards. This buffer should be protected by locks in the same way malloc does. Therefore, printf is also non-reentrant.

malloc size 0

When void *ptr = malloc(size), size == 0, malloc() returns either NULL, or a unique pointer value that can later be successfully passed to free().

MySQL常用命令:

show databases; /* 显示当前所有数据库 */create database test; /* 创建新数据库test */use test;/* 开始使用test */create table user (name varchar(20), sex char(1)); /* 创建表格 */show tables; /* 显示test数据库里面的表格 */drop table user; /* 删除表格user */describe user; /* 显示fields */select * from user /* 显示表内容 */

max_allowed_packet=500M /* 存大量byte */ net stop mysql & net start mysql /* windows下重启mysql (管理员权限)*/

增删查改如果嫌麻烦,直接用mysql-front

艰苦能磨练人的意志。

Microgoogle

相关文章:

  • 【算法】直接插入排序C语言实现
  • 你感兴趣的文章:

    标签云:

    亚洲高清电影在线, 免费高清电影, 八戒影院夜间, 八戒电影最新大片, 出轨在线电影, 午夜电影院, 在线影院a1166, 在线电影院, 在线观看美剧下载, 日本爱情电影, 日韩高清电影在线, 电影天堂网, 直播盒子app, 聚合直播, 高清美剧, 高清美剧在线观看 EhViewer-E站, E站, E站绿色版, qqmulu.com, qq目录网, qq网站目录,