自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Pandoras Box

由于博主精力有限,一些有关以前文章的细节问题,就不一一回复了,希望大家可以谅解 :-)

  • 博客(110)
  • 资源 (14)
  • 收藏
  • 关注

转载 Covariance and Contravariance in Java

extendsThe wildcard declaration of List<? extends Number> foo3 means that any of these are legal assignments:List extends Number> foo3 = new ArrayListNumber>(); // Number "extends" Number (in

2016-06-02 23:53:37 727

转载 Dual NICs doesn't mean double bandwidth

It's very unlikely that bonding your interfaces will result in a speed increase. Typically, even if you bond the interfaces successfully AND configure the switch to support the etherchannel), then you

2015-11-22 12:47:50 626

转载 Standard Compilation & OSR

When the JVM executes a Java method, it checks the sum of those two counters and decides whether or not the method is eligible for compilation. If it is, the method is queued for compilation (see Comp

2015-09-05 14:05:48 805

转载 IoC vs DI

IoC is a generic term meaning rather than having the application call the methods in a framework, the framework calls implementations provided by the application.DI is a form of IoC, where impleme

2015-05-11 23:36:30 654

转载 重复压缩一个文件会出现什么结果?

From: http://stackoverflow.com/questions/1166385/how-many-times-can-a-file-be-compressedFor lossless compression, the only way you can know how many times you can gain by recompressing a fil

2015-04-01 18:57:56 2759

原创 多线程优化——超线程与多核

超线程是利用

2014-06-13 00:01:40 2634

原创 多线程优化——Cache Align

有的时候,使用多线程的速度

2014-06-12 12:02:11 4518

原创 奇怪的并发现象探究——JMM的指令重排、内存级指令重排

我们在平时所习惯的单线程编程中默认了一种乐观的模型——串行一致性。即在程序中只存在唯一的操作执行顺序,并且在每次读取变量时,都能获得在执行序列(任何处理器)最近一次写入该变量的值。但在JMM以及底层的任何一看现代多处理器架构中都不会提供这种串行一致性。这在并发编程中会造成一些在单线程环境下看来难以理解的现象。  比如,如下的java代码:package pack;public

2013-12-31 19:53:40 2740

转载 Distributed garbage collection used in RMI

The RMI subsystem implements reference counting based Distributed Garbage Collection (DGC) to provide automatic memory management facilities for remote server objects.When the client creates (unmars

2013-10-02 20:43:03 846

转载 TLAB ( Thread Local Allocation Buffers )

Reprint:http://robsjava.blogspot.com/2013/03/what-are-thread-local-allocation-buffers.htmlWhen new objects are allocated on the heap, if TLAB ( Thread Local Allocation Buffers ) are enabled, the o

2013-09-30 16:40:30 1398

原创 为什么新生代有两个survivor?

StackOverflow上面给出的解释是:The reason for the HotSpot JVM's two survivor spaces is to reduce the need to deal with fragmentation. New objects are allocated in eden space. All well and good. When that

2013-09-30 16:36:17 3318

转载 CMS工作原理

Reference:  http://www.insightfullogic.com/blog/2013/may/7/garbage-collection-java-3/                         http://blog.griddynamics.com/2011/06/understanding-gc-pauses-in-jvm-hotspots_02.html

2013-09-29 21:12:15 6271

原创 GC日志分析

通过 -XX:+PrintGCDetails 启用日志GC (minor )日志Full GC 日志

2013-09-28 17:12:01 21651 3

转载 新生代、老年代

1. Java堆中各代分布:图1:Java堆中各代分布Young:主要是用来存放新生的对象。Old:主要存放应用程序中生命周期长的内存对象。Permanent:是指内存的永久保存区域,主要存放Class和Meta的信息,Class在被 Load的时候被放入PermGen space区域. 它和和存放Instance的Heap区域不同,GC(Garbage Collection)

2013-09-28 17:06:04 1227

转载 Java Dynamic Proxy

Reprint:http://java.dzone.com/articles/power-proxies-javaIn this article, I’ll show you the path that leads to true Java power, the use of proxies.They are everywhere but only a handful

2013-09-28 15:50:02 1639

原创 Java正则表达式替换的示例

package regex;import java.util.regex.*;import java.io.*;public class Regex { public static void main(String [] args) { String s = "12+3*(2+4)-4*7-1.21"; Pattern pattern = Pattern.compile("

2013-09-28 13:59:06 1136

转载 Class Loader

Reprint:http://www.javaworld.com/jw-10-1996/jw-10-indepth.html?page=1The class loader concept, one of the cornerstones of the Java virtual machine, describes the behavior of converting a named c

2013-09-28 11:44:29 1165

转载 Differences Between 32-bit and 64-bit Systems

Reprint:http://superuser.com/questions/56540/32-bit-vs-64-bit-systemsNote: These answers apply to standard PC CPUs (Intel and AMD) and Windows (as typically configured for end-users). Other

2013-09-28 09:58:08 1181

转载 Why can't 32-bit Windows access 4GB of RAM

Reprint:http://www.pcworld.com/article/2013751/why-cant-32-bit-windows-access-4gb-of-ram.htmlEvery byte of RAM requires its own address, and the processor limits the length of those addresses. A

2013-09-28 09:55:31 928

转载 64位系统的虚存使用

In a 64-bit os, the maximum memory space for a single process is 2^48 bits. (More is theoretically possible, but no chipset on the market actually decodes more than 48 bits of address.)Canonic

2013-09-27 19:38:50 1135

转载 Sizing the Java heap

Size your Java heap so that your application runs with a minimum heap usage of 40%, and a maximum heap usage of 70%.IntroductionAn incorrectly sized Java heap can lead to OutOfMemoryError except

2013-09-27 16:26:40 1153

转载 JVM -XX -X Options

-XXaggressive-XX:AllocChunkSize-XX:+|-CheckJNICalls-XX:+|-CheckStacks-XXcompaction-XXcompactRatio (deprecated)-XXcompactSetLimit (deprecated)-XXcompactSetLimitPerObject (deprecated)-XX

2013-09-26 21:08:17 4681

转载 Shallow vs. Retained Heap

Shallow heap is the memory consumed by one object. An object needs 32 or 64 bits (depending on the OS architecture) per reference, 4 bytes per Integer, 8 bytes per Long, etc. Depending on the heap dum

2013-09-26 20:47:12 1209

转载 Memory Cache Control 摘录

The store buffer is associated with the processors instruction execution units. Itallows writes to system memory and/or the internal caches to be saved and in somecases combined to optimize the pr

2013-09-16 22:35:46 1066

原创 一个关于Memory Reordering的实验

Instruction Reordering有两种,包括Compiler Reordering和Memory Reordering。  Intel官方列出的有关Memory Reordering的情况总共有8种:  Neither Loads Nor Stores Are Reordered with Like Operations  Stores Are Not Reor

2013-09-16 22:08:52 1527

转载 Store-buffer forwarding

Many modern microprocessors implement store buffer forwarding which is a mechanism that improves microprocessor performance by completing a younger dependent load operation by using data from an old

2013-09-14 16:57:30 1378

转载 一个关于Lightweight Mutex 和 Heavyweight Mutex的实验

Reprint:http://preshing.com/20111124/always-use-a-lightweight-mutexIn multithreaded programming, we often speak of locks (also known as mutexes). But a lock is only a concept. To actually use 

2013-09-13 20:16:04 1130

转载 Acquire and Release Semantics

关于 Acqurie Semantics 和 Release Semantics 的解释,感觉MSDN上的解释最容易理解:(http://msdn.microsoft.com/en-us/library/ff540496.aspx)An operation has acquire semantics if other processors will always see its e

2013-09-13 20:11:55 2099

转载 light-weight sync 和 heavy-weight sync

Reprint:http://www.ibm.com/developerworks/systems/articles/powerpc.htmlThe barrier created by the sync instruction is more comprehensive in that it orders all storage accesses regardless of class.

2013-09-13 20:02:37 1041

转载 RISC和CICS指令流水线的区别

Reprint:http://www.surf.org.uk/articles/CISC_vs._RISC.htmlRISC architectures lend themselves more towards pipelining than CISC architectures for many reasons. As RISC architectures have a smalle

2013-09-13 19:59:59 5103

转载 一个关于Weakly-Ordered CPU的实验

Reprint:http://preshing.com/20121019/this-is-why-they-call-it-a-weakly-ordered-cpuOn this blog, I’ve been rambling on about lock-free programming subjects such as acquire and release semanti

2013-09-12 15:35:09 1403

转载 ARM和x86架构的区别与应用

ARM is a RISC (Reduced Instruction Set Computing) architecture while x86 being a CISC (Complex Instruction Set Computing) one.ARM is a RISC (Reduced Instruction Set Computing) archit

2013-09-12 14:51:31 1410

转载 C语言内嵌汇编:__asm__ __volatile__

转自unbutun的博客:http://blog.csdn.net/unbutun/article/details/6123472gcc内嵌汇编简介在内嵌汇编中,可以将C语言表达式指定为汇编指令的操作数,而且不用去管如何将C语言表达式的值读入哪个寄存器,以及如何将计算结果写回C 变量,你只要告诉程序中C语言表达式与汇编指令操作数之间的对应关系即可, GCC会自动插入代码完成必要的操

2013-09-10 20:22:36 5895

转载 跨平台获取CPU cache line大小的方法

Reprint:http://strupat.ca/2010/10/cross-platform-function-to-get-the-line-size-of-your-cache/  注意获得的cache line大小单位为字节。#ifndef GET_CACHE_LINE_SIZE_H_INCLUDED#define GET_CACHE_LINE_SIZE_H_INC

2013-09-09 21:26:02 4112

原创 重要宏收录

#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))//volatile确保不被编译器优化省略,且每次必须直接从内存读值#define DEFINE_PER_THREAD(type, name) \        struct { \                __typeof__(type) v \

2013-09-09 21:21:42 1326

转载 处理器、CPU、核的区别

Reprint:http://www.tomshardware.com/forum/342869-28-difference-processor-coreThe terms 'Processor', 'Core', and 'CPU' are all poorly defined and have undergone many changes in meaning over the y

2013-09-05 08:37:19 2137

转载 Solution to Articulation Points, Bridges, and Biconnected Components Problem

(g)很容易证明(h)经过(f)中的方法算出所有的bridges以后,在G中去除所有的bridges,然后用DFS对G进行遍历,每一个连通图就是一个biconnected component,在遍历过程中对每一个component中节点的tag进行相应赋值。

2013-09-03 19:10:02 1897

转载 用parted调整分区大小

Select the hard disk to be partedWhen you execute parted command without any argument, by default it selects the first hard disk drive that is available on your system.In the following example

2013-08-25 22:31:29 14457

原创 du的使用

du命令的参数组合方式有很多种,有些组合的结果很让人费解,总结一种最常用的:  du -shc *  其中,-s的含义是包含子目录大小,-h的含义是以K,M,G为单位,-c的含义是结尾显示total  假设目录结构是:  Test/dir1/dir1_1/file1.txt  Test/dir2/dir2_1  Test/file.txt  其中

2013-08-25 11:19:21 959

转载 Metaclass in Python

I pick this post from stackoverflow, it's really awesome, thanks fore-satis .  Here is the original link : http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-pythonClasses

2013-08-21 22:40:51 767

Event-based VS Threads

Event-based VS Threads

2015-03-25

Push-Relabel Maximum Matching

基于push-relabel方法解决maximum matching的算法

2013-11-02

Karp’s minimum mean-weight cycle algorithm

好不容易找到的最详细的对MMC算法的解释,可做为算法导论 Problem 24-5 的答案

2013-10-08

CLRS Problems 15-5 Viterbi algorithm

CLRS Problems 15-5 的解法

2013-07-30

ProcessMonitor

注册表实时监视 文件实时监视 网络实时监视

2012-12-01

OSRLOADER安装免重启

安装程序,免重启 安装程序,免重启 安装程序,免重启

2012-09-29

算法导论(中文版)

算法导论(中文版)(现代计算机常用数据结构和算法)

2012-06-25

TortoiseSVN使用教程

TortoiseSVN使用教程,全面详细,很适合入门及手册查阅

2012-06-25

Head First Design Patterns

Head First Design Patterns设计模式入门,英文原版,看起来比翻译版要好很多

2012-06-25

可靠UDP协议的设计思路与实现方法

可靠UDP协议的设计思路与实现方法的一篇论文

2012-06-25

基于UDP传输协议的包丢失和失序处理

基于UDP传输协议的包丢失和失序处理的一篇论文

2012-06-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除