摘要: 概述 说起垃圾收集(Garbage Collection,GC),大部分人都把这项技术当做Java语言的伴生产物。事实上,GC的历史远远比Java久远,1960年诞生于MIT的Lisp是第一门真正使用内存动态分配和垃圾收集技术的语言。当Lisp还在胚胎时期时,人们就在思考: GC需要完成的三件事情: 哪些内存需要回收? 什么时候回收? 如何回收? 经过半个世纪的发展,内存的动态分配与内存回收技术已经相当成熟,一切看起来都进入了“自动化”时代,那为什么我们还要去了解GC和内存分配呢?答案很简单:当需要排查各种内存溢出、内存泄漏问题时,当垃圾收集成为系统达到更高并发量的瓶... 阅读全文
posted @ 2013-04-26 18:24 syrchina 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1 //Server 2 #include <stdio.h> 3 #include <Winsock2.h> 4 #pragma comment(lib, "ws2_32.lib") 5 6 int main() 7 { 8 WORD wVersionRequested; 9 WSADATA wsaData;10 int err;11 12 wVersionRequested = MAKEWORD( 1, 1 );13 14 err = WSAStartup( wVersionRequested, &wsaData );15 if ( er 阅读全文
posted @ 2013-01-06 16:02 syrchina 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <stddef.h> 3 #include <time.h> 4 #include <WinSock.h> 5 #pragma comment (lib,"Ws2_32") 6 7 using namespace std; 8 9 struct NTP_Packet 10 { 11 int Control_Word; 12 int root_delay; 13 int root_dispersion; 14 int ... 阅读全文
posted @ 2013-01-05 18:39 syrchina 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 1 // TimeDlg.cpp : implementation file 2 3 #include "stdafx.h" 4 #include "Time.h" 5 #include "TimeDlg.h" 6 7 #ifdef _DEBUG 8 #define new DEBUG_NEW 9 #undef THIS_FILE 10 static char THIS_FILE[] = __FILE__; 11 #endif 12 13 //////////////////////////////////////////////// 阅读全文
posted @ 2013-01-05 17:06 syrchina 阅读(286) 评论(0) 推荐(0) 编辑