码迷,mamicode.com
首页 >  
搜索关键字:atomic write    ( 15635个结果
VC:使用Windows Socket开发应用程序
基于TCP(面向连接)的Socket编程一、客户端:1、打开一个套接字(Socket);2、发起连接请求(connect);3、如果连接成功,则进行数据交换(read、write、send、recv);4、数据交换完成,关闭连接(shutdown、close);二、服务器端:1、打开一个套接字(So...
分类:Windows程序   时间:2014-08-26 21:05:16    阅读次数:342
LeetCode Solutions : Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the...
分类:其他好文   时间:2014-08-26 17:19:16    阅读次数:191
慢慢完善-小游戏之推箱子
利用数组做为地图,利用数字为各种元素,用简单的语句做出推箱子的效果。staticvoidMain(string[]args){Console.Write("第一关,请按空格键开始");//程序开始,在屏幕上显示这个提醒,然后下面就开始读取键盘输入的按键:ConsoleKeyInfocf=Consol...
分类:其他好文   时间:2014-08-26 17:10:06    阅读次数:363
skynet源码学习 - 读写锁
skynet 利用内置的原子操作来实现的一个读写锁,重点是理解 ”full  memory barrier“ ,UNPv2 中利用互斥和条件变量实现的读写锁。前者是在硬件支持的情况下,显得简单明了,站的层次不一样。 源码贴出来: struct rwlock { int write; int read; }; static inline void rwlock_in...
分类:Web程序   时间:2014-08-26 11:43:26    阅读次数:284
Mina、Netty、Twisted一起学(二):TCP消息边界问题及按行分割消息
在TCP连接开始到结束连接,之间可能会多次传输数据,也就是服务器和客户端之间可能会在连接过程中互相传输多条消息。理想状况是一方每发送一条消息,另一方就立即接收到一条,也就是一次write对应一次read。但是,现实不总是按照剧本来走。MINA官方文档节选:TCP guarantess deliver...
分类:Web程序   时间:2014-08-26 11:02:47    阅读次数:346
[LeetCode] Sudoku Solver(迭代)
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be o...
分类:其他好文   时间:2014-08-26 00:18:35    阅读次数:290
140825●二分法
//二分法查询 Console.Write("请输入数据个数:"); int n = Convert.ToInt32(Console.ReadLine()); int[] no = new int[n]; ...
分类:其他好文   时间:2014-08-25 13:16:04    阅读次数:201
APUE学习笔记——5.4缓冲Buffering
缓冲的几个基本概念     缓冲的作用:减少系统read和write的次数。 全缓冲         系统标准I/O缓冲区被写满时才进行真正的I/O操作。         磁盘文件一般使用全缓冲         全缓冲使用malloc来分配缓冲区 行缓冲         系统遇到换行符时进行真正的I/O操作。         Te...
分类:其他好文   时间:2014-08-25 11:57:14    阅读次数:214
Linearizability(also known as strict or atomic consistency)
In concurrent programming, an operation (or set of operations) is atomic, linearizable, indivisible or uninterruptible if it appears to the rest of the system to occur instantaneously. Atomicity is ...
分类:其他好文   时间:2014-08-25 11:52:54    阅读次数:331
140824●语句应用举例
//降序排序 Console.Write("请输入数据的个数:"); int n = Convert.ToInt32(Console.ReadLine()); int []sz=new int[n]; ...
分类:其他好文   时间:2014-08-25 01:02:03    阅读次数:267
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!