Asynchronous to synchronous thread conversion

R

raavi

Hi
I am now involved in a telnet application.i am using struts
framework for this.the problem i am facing is that i am using a number
of threads in this application and this threads are running
asynchronously and i can't get the stream in one thread from other
one.how is this possible? if anyone have any idea please tell me.Thanks
in advance.
 
C

Chris Smith

raavi said:
I am now involved in a telnet application.i am using struts
framework for this.

You're using Struts for a telnet application? Struts is a framework for
HTTP request-response processing using HTML. It is not designed for
telnet -- which is a completely different protocol employing an
abstraction of constant two-way dialogue. You won't have a lot of
success integrating the two; and you'd be better off just implementing a
telnet server on top of sockets.
the problem i am facing is that i am using a number
of threads in this application and this threads are running
asynchronously and i can't get the stream in one thread from other
one.how is this possible?

It's possible using shared state. This could be a static field
somewhere, or it could be an object that you communicate to each of the
threads' Runnable instances when you create them. Synchronization
becomes very important when you start using shared state, though, so
don't do this until you understand it well. Doug Lea has a good book on
it.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top