计算机与现代化 ›› 2011, Vol. 193 ›› Issue (9): 165-167,.doi: 10.3969/j.issn.1006-2475.2011.09.044

• 应用与开发 • 上一篇    下一篇

基于Java多线程机制的龟兔赛跑程序

杨桦,周静   

  1. 四川交通职业技术学院计算机系,四川 成都 611130
  • 收稿日期:2011-05-09 修回日期:1900-01-01 出版日期:2011-09-22 发布日期:2011-09-22

Program of Race Between Rabbit and Tortoise Based on Java Multi-thread Mechanism

YANG Hua, ZHOU Jing   

  1. Department of Computer, Sichuan Vocational and Technical College of Communication, Chengdu 611130, China
  • Received:2011-05-09 Revised:1900-01-01 Online:2011-09-22 Published:2011-09-22

摘要: 支持多线程机制是Java编程语言的一大重要特性,本文重点介绍基于线程和基于进程的多线程机制的基本概念及其优缺点,以及多线程的定义方法。通过龟兔赛跑程序的实现进一步介绍基于Java多线程机制的应用与实现。

关键词: 多线程, 线程同步, 唤醒, 并发

Abstract: Support multithreading mechanism is a very important characteristic of Java programming language, this article focus on introduces the basic concept and the advantage and disadvantage based on the thread and based on the multi-thread mechanism, as well as multi-thread definition method. Through the program of race between rabbit and tortoise further introduces the realization based on the Java multi-thread mechanism’s application.

Key words: multiple-thread, thread synchronization, wake up, concurrent

中图分类号: