Article View: cn.bbs.comp.lang.java
Article #20762Re: [java��]������ֹһ���̵߳����У�
From: �DZ��������Ӳ�ʿ
Date: Mon, 15 Dec 2003 16:08
Date: Mon, 15 Dec 2003 16:08
34 lines
2981 bytes
2981 bytes
��Ҳ��������������⣬��Ҫ��һ��������I/O�������߳��ⲿ��������߳�
û�뵽ʲô�÷���������������������Ƿ����ķ��������
�����Ҫ�������������I/O����������ô�������̵߳��ⲿclose��
���I/O���������������߳��ڲ�����IJ����ͻ��׳�Exception���������
���ⲿ�ر�����ʱ������һ��flag���߳��ڲ���exception handler���ж�
һ�����flag���������Ҫ�����̣߳���ֱ��return���������ַ���ij�̶ֳ���
��exception handling�����������˳����������
����һ���������ǻ��÷������api������nio������ĸ���channel��selector
��������Ҳ���ʴ�Ϻ�ǣ����������������ã�
�� �� scorpio (Future Unknown) �Ĵ������ᵽ: ��
: �����һ������IJ����Ļ� ��ʲô�ð취��
: �� �� OtherVoices.bbs@bbs.nankai.edu.cn (99SE.Eric.Hsu.��ܿ� �Ĵ������ᵽ: ��
: : boolean isStop = false;
: : public void stopMe() {
: : isStop = true;
: : }
: : public void run() {
: : while (!isStop) {
: : // keep doing something here...
: >> .................<����ʡ��>............
--
���� �Ұ�ѩ���ƽ���ů�ķ���
ѩ���ڻ��� ��Ҳ�������
��ʲô���������� ֻ����һ��ѩ�ļ���
ѩ������ ��Ҳ������ �߳���Ƭ���������
����
ȥ�Ǹ���Զ��Զ Ҳ����� Ҳ�?���ڵĵط�
[m[1;32m�� ��Դ:��Ʈ��ˮ�Ƽ� Freecity.dhs.org��[FROM: happyrobbie][m
Technical Details
Message-ID:
<49ecQI$98S@Freecity.dhs.org>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!FreecityShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: f6cb0,a06d199e370a9806 X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2003-12-15 08:08:19 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!Freecity From: happyrobbie.bbs@Freecity.dhs.org (�DZ��������Ӳ�ʿ) Newsgroups: cn.bbs.comp.lang.java Subject: Re: [java��]������ֹһ���̵߳����У� Date: 15 Dec 2003 16:08:07 GMT Organization: Ʈ��ˮ�Ƽ� Message-ID: <49ecQI$98S@Freecity.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1071504114.A