进程(process)和线程(thread)是操作系统的基本概念,但是它们比较抽象,不容易掌握。最近,我读到一篇材料,发现有一个很好的类比,可以把它们解释地清晰易懂。1.计算机的核心是CPU,它承担了所有的计算任务。它就像一座工厂,时刻在运行。2.假定工厂的电力有限,一次只能供给一个车间使用。也就是...
分类:
编程语言 时间:
2015-08-11 09:59:12
阅读次数:
133
http://www.zhihu.com/question/19732473process发起IO请求同步、异步是指process与IO操作是不是同步(异步IO操作完成主动通知process)阻塞、非阻塞是指process是否会等待(非阻塞process需要不断查看IO是否完成)
分类:
其他好文 时间:
2015-08-10 21:33:59
阅读次数:
103
Process/ThreadModelStopped:进程收到停止信号后停止运行Ready:正在运行Executing正在运行队列中等待Uninterruptiblesleep:不可终端指的不是CPU不响应外部硬件的中断,而是进程不响应异步信号Interruptiblesleep:等待某些事件的发生而被挂起Zombie:进程已终止,但进程的进..
分类:
系统相关 时间:
2015-08-10 20:19:48
阅读次数:
163
ps:将某个时间点的进程运行情况撷取下来
[root@www ~]# ps aux <==观察系统所有的进程数据
[root@www ~]# ps -lA <==也是能够观察所有系统的数据
[root@www ~]# ps axjf <==连同部分进程树状态
选项与参数:
-A :所有的 process 均显示出来,与 -e 具有同样的效用;
-a :不与 terminal 有关的所有 ...
分类:
系统相关 时间:
2015-08-10 20:05:20
阅读次数:
178
---恢复内容开始---多线程基础介绍多线程一词可以解释为多个控制线程或多个控制流。虽然传统的UNIX进程包含单个 控制线程,但多线程(multithreading,MT)会将一个进程分成许多执行线程,其中每个 线程都可独立运行定义多线程术语表1–1多线程术语术语定义Process(进程)通过for...
分类:
编程语言 时间:
2015-08-10 19:46:30
阅读次数:
180
创建 AppRuntime 对象,类 AppRuntime 继承自 AndroidRuntime。
分类:
移动开发 时间:
2015-08-10 18:02:49
阅读次数:
200
Calculate S(n).S(n)=13+23 +33 +……+n3 .Input
Each line will contain one integer N(1 < n < 1000000000). Process to end of file.Output
For each case, output the last four dights of S(N) in one line.Samp...
分类:
其他好文 时间:
2015-08-09 18:57:25
阅读次数:
134
1:android studio 新建工程出错Error:Execution failed for task ':app:preDexDebug'.com.android.ide.common.process.ProcessException: org.gradle.process.internal...
分类:
移动开发 时间:
2015-08-09 18:36:32
阅读次数:
402
一、网络线程 NetworkDispatcher Volley框架中提供NetworkDispatcher类作为工作线程(work thread)处理网络请求,它继承了Thread。NetworkDispatcher在其run()方法中调用了 Process.setThreadPriority(Process....
分类:
编程语言 时间:
2015-08-08 21:32:47
阅读次数:
142
Description
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph...
分类:
其他好文 时间:
2015-08-08 16:41:57
阅读次数:
112