Java中的多处理 [英] Multiprocessing In java

查看:64
本文介绍了Java中的多处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai Guys,

我需要你们的帮助.

我正在为扫描仪创建一个接口,其中有一个名为scan_X()的函数.此过程正在执行扫描和OCR读取.scan_X()返回一个值(0或1).想最后调用另一个函数scan_Y(),但是我不希望scan_X()等到scan_Y()完成(因为它是一个单独的线程).

我尝试通过将scan_Y()作为线程来执行此操作,但是scan_X()直到scan_Y()终止后才返回值.

有人可以帮我吗?

Hai Guys,

I need an Help from you guys.

I am creating an interface for a scanner.In this there is a function called scan_X().This process is doing scanning and OCR reading.This scan_X() is returning a value(either 0 or 1).In this scan_X() i want to call another function scan_Y()at the end,but i don''t want scan_X() wait until the scan_Y() is finished(as it is a separate thread).

I try to do this by making scan_Y() as a thread,but the scan_X() is not returning the value until the scan_Y() is terminated.

Can any one help me in this.
It will be very help full to me.

推荐答案

^ ]

疯狂的猜测:
您正在使用线程分配值.因此,您的主(GUI?)线程需要等待,直到另一个线程完成.

您正在为此应用程序使用一些框架吗?
这些还为线程处理提供了一些很好的帮助.
Java Thread Tutorial[^]

A wild guess:
You are assigning a Value by using the Thread. Therefor your main (GUI?)thread needs to wait until the other Thread is finished.

Are you using some Framework for this application?
Those also provide some good assisted for Thread-Handling.


这篇关于Java中的多处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆