Questions for the experts out here...
I am very new to java... I treat it as C till now..but now i have to do multithreading for what i want to achieve...
Any suggestions on how to perform multithreading in java...
I got four programs , each of them gets a packet of data and check the first four bytes and compares them to last 4 bytes and if the difference is greater than 2 then they overwrite the file else they write it in to file.I have now synchronization issues since i have four independant programs..i want to merge them together.
Ideally i would like to start 4 threads , each thread receiving packets independantly ,cacultes the difference and the difference value has to be passed to the main function where i would check the values of all threads, would decide if i want to overwrite all the files of each thread or write data into it.
Any idea how to pass data between threads ?
Would really appreciate the help.