I would like to know, how to create separate instance of a class for each thread.
For example, I have o process set of records using threads. Consider 1000 records and 5 threads. Each thread should process 200 records and write into 5 text files. First thread should write into file1, second thread into file2 and so on... How do i know which thread is currently running and how to write into the correct fie. The file processing and data processing are in one class and thread calling is in another class. If i am creating 5 threads, each thread should have it's own class. When the second thread is created, the first thread is getting disconnected. that is, only some data is written into file1 and once the second file is created its not writing the remaining data into first. Always the last file has all data and other files has only few records.
Please any help.
Thanks in advance