Search:

Type: Posts; User: Fragle

Search: Search took 0.10 seconds.

  1. Re: Ordering messages from multiple consumers without using synchronized

    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...
  2. Replies
    3
    Views
    2,523

    Re: Help in stopping thread (Packet sniffer)

    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...
  3. Re: Ordering messages from multiple consumers without using synchronized

    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...
  4. Re: Ordering messages from multiple consumers without using synchronized

    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...
  5. Re: Ordering messages from multiple consumers without using synchronized

    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...
  6. Re: Ordering messages from multiple consumers without using synchronized

    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...
  7. Re: Ordering messages from multiple consumers without using synchronized

    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...
  8. Re: Ordering messages from multiple consumers without using synchronized

    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.
  9. Re: Ordering messages from multiple consumers without using synchronized

    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...
  10. Re: Ordering messages from multiple consumers without using synchronized

    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...
  11. Ordering messages from multiple consumers without using synchronized

    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...
Results 1 to 11 of 11