Remmarguts' Date
Time Limit: 4000MS
Memory Limit: 65536K
Total Submissions: 21084
Accepted: 5740
Description
"Good man never makes girls wait or breaks an appointment...
分类:
其他好文 时间:
2014-08-17 14:22:12
阅读次数:
250
epoll的相关系统调用epoll只有epoll_create,epoll_ctl,epoll_wait 3个系统调用。1. int epoll_create(int size);创建一个epoll的句柄。自从linux2.6.8之后,size参数是被忽略的。需要注意的是,当创建好epoll句柄后,...
分类:
其他好文 时间:
2014-08-16 19:41:51
阅读次数:
243
通知栏 设置提醒标志符Flags功能:提醒标志符,向通知添加声音、闪灯和振动效果等设置达到通知提醒效果,可以组合多个属性使用方法(其一):Notification notify = mBuilder.build();notify.flags = Notification.FLAG_AUTO_CANC...
分类:
移动开发 时间:
2014-08-15 19:13:19
阅读次数:
2231
Pulse(lockObj)表示释放当前被lock的lockObj,容许其它线程调用。(相当于临时挂起当前线程)Wait(lockObj)表示等待当前被其它线程占用的lockObj。以下的代码将会交替运行两个线程:class TickTock { object lockOn = ...
分类:
编程语言 时间:
2014-08-15 17:39:39
阅读次数:
219
Applications can use event
objects in a number of situations to notify a waiting thread of the occurrence of an event. For example, overlapped
I/O operations on files, named pipes, and communicati...
分类:
编程语言 时间:
2014-08-14 23:59:16
阅读次数:
509
Remmarguts' Date
Time Limit: 4000MS
Memory Limit: 65536K
Total Submissions: 21064
Accepted: 5736
Description
"Good man never makes girls wait or breaks an appointme...
分类:
其他好文 时间:
2014-08-14 20:37:39
阅读次数:
266
说明
Java中,线程之间的通信主要是由java.lang.Object类提供的wait、notify和notifyAll这3个方法来完成:
①对象的wait方法被调用后,线程进入对象的等待队列中,并释放对象锁,其它线程可以竞争使用此对象锁;sleep方法使得一个线程进入睡眠状态,但是线程所占有的资源并没有释放。
②当对象的notify方法被调用,该方法会从对象的等待队列中随机取出一个线...
分类:
编程语言 时间:
2014-08-13 13:05:56
阅读次数:
270
下面是一个生产者消费者问题,来介绍condition_variable的用法。当线程间的共享数据发生变化的时候,可以通过condition_variable来通知其他的线程。消费者wait 直到生产者通知其状态发生改变,Condition_variable是使用方法如下:·当持有锁之后,线程调用wa...
分类:
编程语言 时间:
2014-08-13 00:55:04
阅读次数:
341
网上关于android,fence的资料好少啊,几乎没有,但是这个机制又在GUI系统中起着重要的作用,于是自己通读源码和注释,与大家分享下Fence到底是怎么回事?
Fence即栅栏,栅栏的角色与它的名字非常类似.一组线程可以使用栅栏来集体进行相互同步;在本质上,每个线程在到达某种周知的状态时调用栅栏的wait()方法,阻塞起来,以等待其它所有参与线程调用wait()方法表明它...
分类:
移动开发 时间:
2014-08-12 19:09:04
阅读次数:
310
Insertion Sort is a simple sorting technique which was covered in previous challenges. Sometimes, arrays may be too large for us to wait around for in...
分类:
其他好文 时间:
2014-08-12 18:13:14
阅读次数:
404