michile

导航

2013年2月5日

IIPC--share memory

摘要: 5.1 Shared MemoryOne of the simplest interprocess communication methods is using shared memory.Shared memory allows two or more processes to access the same memory as if they allcalled mallocand were returned pointers to the same actual memory.When oneprocess changes the memory, all the other proces 阅读全文

posted @ 2013-02-05 22:32 michile 阅读(344) 评论(0) 推荐(0) 编辑

IPC 类型

摘要: *Shared memory permits processes to communicate by simply reading and writing to a specified memory location.*Mapped memory is similar to shared memory, except that it is associated with afile in the filesystem.*Pipes permit sequential communication from one process to a related process.*FIFOs are s 阅读全文

posted @ 2013-02-05 22:14 michile 阅读(140) 评论(0) 推荐(0) 编辑

process VS thread

摘要: For some programs that benefit from concurrency, the decision whether to useprocesses or threads can be difficult. Here are some guidelines to help you decidewhich concurrency model best suits your program:n All threads in a program must run the same executable. A child process, on theother hand, ma 阅读全文

posted @ 2013-02-05 22:06 michile 阅读(232) 评论(0) 推荐(0) 编辑

advacing lnux program -- 4.4.7Deadlocks with Two or More Threads[copy]

摘要: Deadlocks can occur when two (or more) threads are each blocked, waiting for a con-dition to occur that only the other one can cause. For instance, if thread A is blockedon a condition variable waiting for thread B to signal it, and thread B is blocked on acondition variable waiting for thread A to 阅读全文

posted @ 2013-02-05 21:58 michile 阅读(160) 评论(0) 推荐(0) 编辑

vi 替换命令使用说明

摘要: Linux系统攻略关于vi替换命令的使用说明vi/vim 中可以使用 :s 命令来替换字符串。以前只会使用一种格式来全文替换,今天发现该命令有很多种写法(vi 真是强大啊,还有很多需要学习),记录几种在此,方便以后查询。:s/vivian/sky/ 替换当前行第一个 vivian 为 sky:s/vivian/sky/g 替换当前行所有 vivian 为 sky:n,$s/vivian/sky/ 替换第 n 行开始到最后一行中每一行的第一个 vivian 为 sky:n,$s/vivian/sky/g 替换第 n 行开始到最后一行中每一行所有 vivian 为 skyn 为数字,若 n 为 . 阅读全文

posted @ 2013-02-05 17:33 michile 阅读(220) 评论(0) 推荐(0) 编辑

ubuntu proxy

摘要: 升级到Ubuntu10.04后,发现apt-get的代理设置有改变了,在9.10以前使用“http_proxy”环境变量就可以令apt-get使用代理了export http_proxy=http://127.0.0.1:8000sudo apt-get update然后在Ubuntu10.04下就无效了,看来apt-get已经被改成不使用这个环境变量了。一阵郁闷后,最后我发现在“首选项”->“网络代理”那里,多了个“System-wide”按钮(我用的是英文环境,不知道中文被翻译成怎样,关闭窗口时也会提示你),在这里设置后,apt-get确实可以使用代理了。但是我依然鄙视这种改进,因为 阅读全文

posted @ 2013-02-05 17:16 michile 阅读(2591) 评论(0) 推荐(0) 编辑