Multiple Threads
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mike_jarito
Posted On:   Monday, May 6, 2002 11:23 PM

i have an application that should start a databaseReader thread, a Worker thread and a Sender thread. The databaseReader thread just pools a database table and buffers data into a list. After doing the query, it will check if the buffer is full, if yes it'll wait else it will continue buffering. The Worker thread is passed the databaseReader object, which should be already running. This worker gets data from the buffer(which is field of the databaseReader) The worker thread spawns sender threads for each data retrieved from the buffer. Now my line of code looks like this: public static void main(String[] args){ DbReaderThread dbReader=new DbReaderThread(); dbReader.start()   More>>

i have an application that should start a databaseReader thread, a Worker thread and a Sender thread.

The databaseReader thread just pools a database table and buffers data into a list. After doing the query, it will check if the buffer is full, if yes it'll wait else it will continue buffering.

The Worker thread is passed the databaseReader object, which should be already running. This worker gets data from the buffer(which is field of the databaseReader)

The worker thread spawns sender threads for each data retrieved from the buffer.

Now my line of code looks like this:


public static void main(String[] args){
DbReaderThread dbReader=new DbReaderThread();
dbReader.start();
SdmWorker sdmWorker=new SdmWorker(dbReader);
sdmWorker.start();
}




but what happens is that the SdmWorker isnt even instantiated. What happens? Isnt it that immediately after a call to a thread's start() the next statemet should be excuted next? Pls enlighten me. :(    <<Less
About | Sitemap | Contact