help with threads

Hello everyone,

I am having some trouble getting my head round the threads and was hoping someone may be able to help me out, here's my situation:

I am creating a client-server app using RMI. On the server I have one process which will be iterated indefinitely (lets call this thread1), however there are a number of other methods on the server which will be called by clients. Upon invocation of one of these methods I want the server to suspend thread1 execute the invoked method and then return to thread1.

Are threads the correct option for this? if so are my ideas realistic?

Any help\direction will be very much appreciated.

Thanks ahead

[683 byte] By [jamstara] at [2007-11-26 22:27:44]
# 1
yes what you want is possible, but lets step back first.. can you tell us what is going on in more detail? why is one thread always reading, and why does it need to stop when clients do stuff?
mkoryaka at 2007-7-10 11:30:25 > top of Java-index,Java Essentials,Java Programming...
# 2

Ok, the application is an auction system.

I have created a class to represent the auction.

The thread which is continuously runing is checking weather auctions have ended ie their end time property is in the past.

The methods which will interupt this thread do the following:

- accept bids

- create new auctions

- connect client (store reference to object in hashtable)

- disconnect client (remove reference from hashtable)

Thanks for your quick reply

jamstara at 2007-7-10 11:30:25 > top of Java-index,Java Essentials,Java Programming...