Java多线程处理
来源:56doc.com 资料编号:5D12413 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D12413
资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 密 保 惠 帮助
资料介绍
Java多线程处理(中文5400字,英文3500字)
摘要
利用对象,可将一个程序分割成相互独立的区域。我们通常也需要将一个程序转换成多个独立运行的子任务。
象这样的每个子任务都叫作一个“线程”(Thread)。编写程序时,可将每个线程都想象成独立运行,而且都有自己的专用CPU。一些基础机制实际会为我们自动分割CPU的时间。我们通常不必关心这些细节问题,所以多线程的代码编写是相当简便的。
这时理解一些定义对以后的学习狠有帮助。“进程”是指一种“自包容”的运行程序,有自己的地址空间。“多任务”操作系统能同时运行多个进程(程序)——但实际是由于CPU分时机制的作用,使每个进程都能循环获得自己的CPU时间片。但由于轮换速度非常快,使得所有程序好象是在“同时”运行一样。“线程”是进程内部单一的一个顺序控制流。因此,一个进程可能容纳了多个同时执行的线程。
英文原文
Java multi-threaded processing
Summary
Using object, a program can be divided into separate areas. We usually also need a program into multiple independent subtasks run.
Each sub-task like this are called a "thread" (Thread). Preparation process, each thread can be imagined as an independent operation, and has its own dedicated CPU. Some basic mechanisms for us to automatically split the actual CPU time. We usually do not care about these details, so write multithreaded code is fairly simple.
Then understand some definitions for future learning ruthless help. "Process" refers to a "self-contained" in running the program, with its own address space. "Multi-tasking" operating system can simultaneously run multiple processes (programs) - but actually it is because the CPU time-sharing mechanism, so that each process can obtain its own CPU cycle time slice. However, due to the rotation speed is very fast, so that all procedures seems to be in the "simultaneous" run the same. "Threads" is the process of an internal single sequential flow of control. Therefore, a process may accommodate multiple simultaneous execution threads. |