前些天看aop就看到了cglib,看cglib又看到了asm,模仿着做了个示例。利用asm修改字节码,能实现编译不通过执行通的过的效果,挺有意思。
一个简单的待修改类:
package com.asm.zjc;
public class C {
public void m() throws InterruptedException{
Thread.sleep(300);
}
}...
分类:
其他好文 时间:
2014-08-13 10:36:55
阅读次数:
255
前些天看aop就看到了cglib,看cglib又看到了asm,模仿着做了个示例。利用asm修改字节码,能实现编译不通过执行通的过的效果,挺有意思。一个简单的待修改类:packagecom.asm.zjc;
publicclassC{
publicvoidm()throwsInterruptedException{
Thread.sleep(300);
}
}
对其进..
分类:
其他好文 时间:
2014-08-13 03:43:06
阅读次数:
234
thread_group是boost库中的线程池类,内部使用的是boost::thread。随着C++ 11标准的制定和各大编译器的新版本的推出(其实主要是VS2012的推出啦……),本着能用标准库就用标准库的指导原则,决定把项目中多线程相关的部分代码从boost::thread迁移到std::th...
分类:
其他好文 时间:
2014-08-13 00:59:24
阅读次数:
191
1、实现多线程方法:其实就是多个线程同时调用io_service::run for (int i = 0; i != m_nThreads; ++i) { boost::shared_ptr pTh(new boost::thread( boost::bind(&...
分类:
编程语言 时间:
2014-08-12 00:34:33
阅读次数:
1592
问题描述
最近代码里使用了webview,主要是使用webview load了远程的url。但是我从实现了javascript接口,调用javascript中方法刷新url时,发现刷新代码没有实际效果。示例代码如下:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceSta...
分类:
移动开发 时间:
2014-08-11 21:26:12
阅读次数:
281
By Andrei Alexandrescu, October 01, 2004
Post a Comment
Lock-free data structures guarantee the progress of at least one thread when executing mutlithreaded procedures, thereby helping you avoid d...
分类:
其他好文 时间:
2014-08-11 18:01:02
阅读次数:
384
A synchronization point at which threads can pair and swap elements within pairs. Each thread presents some object on entry to the
exchange method, matches with a partner thread, and receives its par...
分类:
其他好文 时间:
2014-08-11 17:57:12
阅读次数:
303
1.
NSThread *thread=[[NSThread alloc] initWithTarget:self selector:@selector(saleTicketMethod:) object:@"线程--1"];...
分类:
移动开发 时间:
2014-08-11 15:03:12
阅读次数:
243
本文是学习网络上的文章时的总结,感谢大家无私的分享。
1、一个多个线程在执行的Java程序,只有当其全部的线程执行结束时(更具体的说,是所有非守护线程结束或者某个线程调用System.exit()方法的时候),它才会结束运行。有时,你需要为了终止程序而结束一个线程,或者当程序的用户想要取消某个Thread对象正在做的任务。
2、Java提供中断机制来通知线程表明我们想要结束它。中断机制的特...
分类:
编程语言 时间:
2014-08-11 15:00:32
阅读次数:
257
最近重新研究Java基础知识,发现以前太多知识知识略略带过了,比较说Java的线程机制,在Java中有两类线程:User Thread(用户线程)、Daemon Thread(守护线程),(PS:以前忽略了)。 估计学过Unix开发但是没有细致学习Java的同学们会疑惑了,操作系统里面是没有所谓的守...
分类:
编程语言 时间:
2014-08-11 14:35:43
阅读次数:
228