Open Nav

JAVA中的多线程(含外文出处)

以下是资料介绍,如需要完整的请充值下载.
1.无需注册登录,支付后按照提示操作即可获取该资料.
2.资料以网页介绍的为准,下载后不会有水印.仅供学习参考之用.
   帮助中心
资料介绍:

JAVA中的多线程(含外文出处)(中文5900字,英文3500字)
摘要:本文详细的介绍了JAVA语言的概念,JAVA面向对象的思想,JAVA设计模式,多线程和部分实例解说。并将JAVA中的多线程以简易明了的语句阐明清楚,讲解深入浅出,内容系统全面。
关键字:JAVA语言 面向对象 实例
JAVA中的多线程
利用对象,可将一个程序分割成相互独立的区域。我们通常也需要将一个程序转换成多个独立运行的子任务。象这样的每个子任务都叫作一个“线程”(Thread)。编写程序时,可将每个线程都想象成独立运行,而且都有自己的专用CPU。一些基础机制实际会为我们自动分割CPU 的时间。我们通常不必关心这些细节问题,所以多线程的代码编写是相当简便的。这时理解一些定义对以后的学习狠有帮助。
“进程”是指一种“自包容”的运行程序,有自己的地址空间。“多任务”操作系统能同时运行多个进程(程序)——但实际是由于CPU 分时机制的作用,使每个进程都能循环获得自己的CPU 时间片。但由于轮换速度非常快,使得所有程序好象是在“同时”运行一样。“线程”是进程内部单一的一个顺序控制流。因此,一个进程可能容纳了多个同时执行的线程。

[资料来源:http://Doc163.com]



Concurrent programming allows you to partition a program into separate, independently running tasks. Using multithreading, each of these independent tasks (also called subtasks) is driven by a thread of execution. A thread is a single sequential flow of control within a process. A single process can thus have multiple concurrently executing tasks, but you program as if each task has the CPU to itself. An underlying mechanism divides up the CPU time for you, but in general, you don’t need to think about it.
The threading model is a programming convenience to simplify juggling several operations at the same time within a single program: The CPU will pop around and give each task some of its time. 4 Each task has the consciousness of constantly having the CPU to itself, but the CPU’s time is being sliced among all the tasks (except when the program is actually running on multiple CPUs). One of the great things about threading is that you are abstracted away from this layer, so your code does not need to know whether it is running on a single CPU or many. Thus, using threads is a way to create transparently scalable programs—if a program is running too slowly, you can easily speed it up by adding CPUs to your computer.

[资料来源:http://www.doc163.com]

  • 关于资料
    提供的资料属本站所有,真实可靠,确保下载的内容与网页资料介绍一致.
  • 如何下载
    提供下载链接或发送至您的邮箱,资料可重复发送,若未收到请联系客服.
  • 疑难帮助
    下载后提供一定的帮助,收到资料后若有疑难问题,可联系客服提供帮助.
  • 关于服务
    确保下载的资料和介绍一致,如核实与资料介绍不符,可申请售后.
  • 资料仅供参考和学习交流之用,请勿做其他非法用途,转载必究,如有侵犯您的权利或有损您的利益,请联系本站,经查实我们会立即进行修正! 版权所有,严禁转载
    doc163.com Copyright © 2012-2024 苏ICP备2021029856号-4