wood burning stoves*
The moose likes Threads and Synchronization and the fly likes not sure whether this thread works or not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "not sure whether this thread works or not" Watch "not sure whether this thread works or not" New topic
Author

not sure whether this thread works or not

Sara Brown
Ranch Hand

Joined: Feb 22, 2012
Posts: 55




i believe my threads are not working well. is there any way to make it work, please. i have been try so many ways but it still end up the same thing. please i dont know what else to do.
Sara Brown
Ranch Hand

Joined: Feb 22, 2012
Posts: 55
i have made the thread at the cipher. but still the performance does not effect much. is there any tips or helps or guide for me making the threads work well?

Thank you for your help.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

First of all, please adhere to Java conventions for Class naming.

Other than that, I am not going to wade through and debug your code.

Please let us know how far it gets successfully, and then the failure condition(s).

debug, logging, and at a last resort; System.out.println() are your friends.

WP
Sara Brown
Ranch Hand

Joined: Feb 22, 2012
Posts: 55
the result for the encryption and decryption whether by using ECB and CBC mode are the same. means that bob and alice retrieve the same secret message.

however, when it comes to the performance, using only 1 thread gives much faster than large number.

I have been reading that we could make it parallel at the cipher but when i look back at my code, i think my algorithm is the same way of sequential one thus it does not make it faster but slowest.

I dont know what else to put to make my thread works. i have been working on plenty of design but it still works the same way. above code is my last code i have been modified.

i have no idea to make it parallel. please, i really need help design this algorithm.

is there any potential place to put the thread other than at the cipher?
Sara Brown
Ranch Hand

Joined: Feb 22, 2012
Posts: 55
This is what i do. after we know that alice and bob shared the same secret message, i pass it to a new thread as below.



then it will run back at the run method which is the overide. what i do in the run method is this.



which it will pass to a new method called goKey. and in the goKey() i put it this way.



the goKey() will identify whether it will generate the key or do the encrypt. if the count is 1 then it will pass to new method. and that method will do the cipher.



this cipher will do in two different modes which are in ECB and CBC.



this to make it more clear about what i do in the above code.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: not sure whether this thread works or not
 
Similar Threads
DHPublicKey not for this KeyAgreement!
Algorithm DES not available
Please guide me to do encryption with thread; RejectedExecutionException
decryption resulting in BadPaddingException
Exception while decrypting the string