在写前面两篇文章23和24的时候自己有很多细节搞得不是很明白,这篇文章把Fork和Work-Stealing相关的源代码重新梳理一下。首先来看一些线程池定义的成员变量:关于scanGuard:volatile int scanGuard;private static final int SG_UNI...
分类:
编程语言 时间:
2014-09-17 18:17:22
阅读次数:
296
private static final String FILE_MEMORY = "/proc/meminfo"; private static final String FILE_CPU = "/proc/cpuinfo";/** * 得到IMEI * * @re...
分类:
移动开发 时间:
2014-09-17 16:45:12
阅读次数:
263
堆栈类: package?c15; public?class?LinkedStack<T> { ???????private?static?class?Node<T> { ????????????T?item?; ????????????Node<T>?next?; ?????????...
分类:
编程语言 时间:
2014-09-17 12:16:02
阅读次数:
237
private static int getStatusHeight(Context context){
int statusHeight = 0;
Rect localRect = new Rect();
((Activity) context).getWindow().getDecorView().getWindowVisibleDisplayF...
分类:
移动开发 时间:
2014-09-17 01:11:41
阅读次数:
249
private static void BubbleSort(int[] a,int n){ boolean flag = false; int temp; for (int i = 0; i i; j--) { if(a[j-1]>a[j]) { /*te...
分类:
编程语言 时间:
2014-09-16 23:39:01
阅读次数:
223
一直都在想如何在Java写一个抽象类,让该抽象类的所有子类都限定为单例模式,一个类需要设计成单例时直接继承该抽象类,而单例的限定与实例获取交给抽象类来完成。一个传统的单例类形如一下形式: 1 public class Singleton { 2 private static final...
分类:
其他好文 时间:
2014-09-16 21:46:31
阅读次数:
379
public class EncryptDESString { //默认密钥向量 private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; /// ...
分类:
其他好文 时间:
2014-09-16 18:47:50
阅读次数:
171
语言集查询(Language Intergrated Query,LINQ)示例:private static void LinqQuery(){ var query = from r in Formulal.GetChampions() where r.Country ...
分类:
其他好文 时间:
2014-09-16 15:42:10
阅读次数:
176
private static string GetHtmlDomAttr(string html, string id, string attrname) { string xmatchstring = "]+id=\"{0}\"\\s*{1}=\"(?\\S*)...
分类:
Web程序 时间:
2014-09-16 15:38:50
阅读次数:
149
public static class DownLoad_HTML { private static int FailCount = 0; //记录下载失败的次数 public static string GetHtml(string url) //传入...
分类:
Web程序 时间:
2014-09-15 00:59:57
阅读次数:
285