Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am looking to create a custom EventProcessors in Disruptor but the documentation is very minimal. (https://code.google.com/p/disruptor/wiki/DisruptorWizard) How is this done. What are the concepts behind it and what are the issues and pitfalls?
Your question is very broad, so is my answer.
the concept behind the event processor is that it processes one event at a time in a single thread.
the issue is that you must decompose you system into asynchronous events.
pitfalls: it may be much more complicated than you need unless you really need millions of events per second. (And this is pretty rare out side HFT)
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm looking for a way to thread the ViewModels in a MVVM Architecture, without having to use tasks everywhere.
My ideal solution would be :
1 Application Thread (with the view)
1 Background Thread (with the viewModel)
Message passing between the 2
ViewModels still behave as normal Java Classes w/o Tasks/Service/Platform.runlater in every method
Is there a way to do this without bloating the code ?
This is probably not going to work the way you would like it to work. The view-models normally communicate with the views via bound properties. Therefore the properties of the view-models must always be updated on the application thread.
The proposed JavaFX way of dealing with concurrent background activities is to use Services. But if you don't like that it maybe worth it to have a look here: https://github.com/ReactiveX/RxJavaFX
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I understand we can do this with file input and output, but why would we want to do this?
It is simply called persistence.
You nailed it: you want to be able to store information (for example after intensive computations) in a way that survives the lifetime of the current JVM process.
In that sense serialization is a (poor) version of database storage.
But of course, that comment is correct: this does not prevent the creation of objects. It is a mechanism to resurrect previous state into "new" objects.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What is the difference between Collectors & Collector. I know that one is interface & one is class. I want to know with example what is the actual difference and When to use which one with real time example.
Hi all I already mentioned in my question I know the basic difference and I gone through the documentation also, I just want to know the purpose to introduce this two thing with example and When should use which one?
Collectors is just a class with static methods which create commonly used Collectors.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
How important is it to use labels in Java? I haven't seen labels used, except in academic books.
I saw them used with jump statements such as break and continue.
You can use labels, but they are considered bad form in general, sort of unrestrained jumping within a method, it makes the code harder to maintain and can introduce bugs if not handled carefully.
As a rule with OO there is usually an easier/better way to achieve things.
In too many years of coding Java I have never used a label.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need a thread-safe Queue and my question is that are there any performance difference between the queue I implement using List and wait/notify (simplest implementation) and classes such ArrayBlockingQueue and etc.?
The question is too vague to be answerable. Here is my advice:
If there is a standard class that does the job, use it in preference to rolling out your own.
Profile your code on realistic inputs to see where the bottlenecks are.
Optimize as appropriate.