方法一:新建分区使用fdisk工具新建一个分区[root@VM_168_102_centos~]#fdisk/dev/xvdb
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabel
BuildinganewDOSdisklabelwithdiskidentifier0xad066822.
Changeswillremaininmemoryonly,untilyoudecidetowrite..
分类:
其他好文 时间:
2014-08-22 18:06:09
阅读次数:
342
好无力,今天改到了自认为的最优法,还能超时吗???#include#include#define bool int //两个数据的交换void swap(int *a,int *b) { int temp; temp = *a; *a = *b; *b = temp;}//优...
分类:
其他好文 时间:
2014-08-22 17:46:09
阅读次数:
167
java里方法的参数传递方式只有一种:值传递例如:void swap(int a,int b){tmp = a;a = b;b = tmp;}并不能交换a,b的值void swap(DataWrap dw){tmp = dw.a;dw.a = dw.bdw.b = tmp;}可以交换,因为DataW...
分类:
其他好文 时间:
2014-08-22 14:21:38
阅读次数:
199
1,Selection SortSteps:from 0~n-1, select the minimum element[comparing n-1 times], swap it with the A[0].from 1~n-1,select the minimum element[compari...
分类:
其他好文 时间:
2014-08-21 22:39:14
阅读次数:
268
13.31为你的HasPtr类定义一个#include#include#include#includeusing namespace std;class HasPtr{friend void swap(HasPtr&,HasPtr&);public: HasPtr(const string &...
分类:
其他好文 时间:
2014-08-21 22:35:14
阅读次数:
446
创建SWAP文件(下面指定的是8G容量,系统物理内存8G):dd if=/dev/zero of=/data/swapfile bs=1M count=8192格式化该文件mkswapswapfile加载为swapswaponswapfile查看swap情况:free -m结果:Swap: ...
分类:
系统相关 时间:
2014-08-21 20:55:24
阅读次数:
221
在并发处理应用中,一般使用锁的方式来解决竞争问题,但锁的效率比较低,因此,在高并发处理中,无锁队列成为应用的需要。CAS无锁算法主要依赖于处理器的支持,绝大多数处理器都支持:
X86平台:CMPXCHG 汇编指令。
在一个指令周期内执行完成,因此是原子性的。
这一原理性操作过程如果采用C描述如下:
intcompare_and_swap (int* reg, int old...
分类:
其他好文 时间:
2014-08-21 19:32:34
阅读次数:
207
在C++中,函数参数传递有3种方式,分别是按值传递、按地址传递和按引用传递。其测试代码如下: 1 //Parameter Transmission in C++ 2 #include 3 using namespace std; 4 5 void swap_value(int a,int b)...
分类:
其他好文 时间:
2014-08-21 01:30:23
阅读次数:
290
vmstat# vmstat 3 2procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- r b swpd free buff cache si so bi ...
分类:
其他好文 时间:
2014-08-21 01:27:33
阅读次数:
276
swap的功能是应付物理内存不足的状况,用硬盘来暂时放置内存中的信息。 对于一般主机,物理内存都差不多够用,所以也就不会用到swap,但是对于服务器而言,当遇到大量网络请求时或许就会用到。 当swap被使用的时候,主机的硬盘灯就会闪烁不停。 本篇介绍两种方式:1、设置一个swap分区 2...
分类:
系统相关 时间:
2014-08-19 23:48:55
阅读次数:
320