I beleive I'm still failing to get the problem across. I'm not saying there is little concurrency. I'm saying that the most optimal and correct I have found is to use the synchronized method approach...
Type: Posts; User: Fragle
I beleive I'm still failing to get the problem across. I'm not saying there is little concurrency. I'm saying that the most optimal and correct I have found is to use the synchronized method approach...
If you are going to use your own variable to indicate a request to stop then don't forget to make the variable 'volative' other wise the thread code may not see the changes made to it from other...
So I agree with most of what you're saying and I'm not trying to defend the current code I have. It has a hole in it which I don't know how to fix and probably more I don't know about. I think I've...
I can see how that would work if I had a consumer-producer model where a consuming thread was given the responsibility of retrieving in sequence. That's not what I have here though. If the sequencing...
Could be Interesting. I can't see how I'd use it though. My understanding is that it ensures you take the items with the highest priority, but I wouldn't think it'd preserve order for me.
I...
Okay. I just checked and it works as long as you need junit4 in the classpath. If you don't have that don't worry
As I explained I am already aware of the flaws in the code, and the test won't...
I'd be disapointed to lose your input. If you add the following you can run the Junits from a main method. It any test fails you'll get an acception. You might need remove the @Test annotations from...
Sorry, I pasted the wrong code into that last post. I've fixed it now. It's a JUnit4 test case. I assume that's OK, I don't tend to use main methods for test code.
Here are my test cases:
I don't think they are two great. I find it quite challenging to write good multi-threaded test cases.
This was was not too bad for my first attempt at the concurrent...
Ok. Done that now (still learning how the forum works!).
I'm trying to avoid the synchronized method because it's not offering much concurreny. There are many calling threads and I don't want them...
My first post here. Hi everyone.
I've got a little challenge for those into concurrent programming. Sometimes I'll find a way to use conccurent collections or atomics to improve concurrency but...