Differences between C++11, C# and Java memory models [closed] - java

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 know that C++11 memory model was inspired from Java memory model, but there has to be something that differentiates both these memory models.
Java uses synchronize and mutexes
C++11 uses atomics and mutexes
C# uses volatile
But what are the fundamental differences between these three in terms of multithreading in memory and in terms of read/write accesses for threads? Which memory model is better out of those three models? Can anyone please shed a light on this topic(only the differences) in detailed manner or provide a link that i can refer to? And how efficiently can these implemented on various real time systems?
Thanks in advance!

While this does not quantify the differences between the C++11 memory models, it does go into great detail about the C++11 model, which is the most recently codified, and therefore likely the most modern:
http://herbsutter.com/2013/02/11/atomic-weapons-the-c-memory-model-and-modern-hardware/
Once you understand C++11's model as a starting point, that will give you better tools for asking about other languages.

Related

What is Robust in java [closed]

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 3 years ago.
Improve this question
I know that Robust is a Feature of java programming language. But I don't know what is the exact meaning of it and how to any programmer benefited by it.
It's a generic adjective that means different things for different people. There's no measure of robustness, so you can't say "this language is more robust than that".
It might be used to differentiate a language from a "toy" language, that isn't meant for general purpose programming, but you aren't going to find any clear definitions, because there isn't one.
Robust simply means heavy and strong and Java has a lot of facilities for programmers such as memory management, security features, networking features etc.
For details regarding exact meaning of feature "Robust", you can follow this link https://www.javatpoint.com/features-of-java

What are the drawbacks of choosing nodejs over asp.net or java for any products? [closed]

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 5 years ago.
Improve this question
There are lots of programming languages available in the market then how do we decide what programming language we should use for our products?
What are the key factors we should consider before using any programming language?
What are the capabilities of language we should check for long term?
Please share your views
Let me start with your 2nd Question - "Long Term", well dont assume the Programming Language alone will help you for the long term. Of course Language will have its impact but take a look at the Architecture when you want to think about Long Term.
Both Java and JavaScript are very capable languages, you must identify your Software Requirement and decide on what language is the best for you.
e.g. If its a Quick project (such as an Adacemic assignment) making use of Node will get you off the ground faster.
Pay attention to the Quality Attributes and think what is the best choice for you...
Performance: You'll find various benchmarks stating Node may not be the best choice if you wants to do heavy lifting.
In General for Factors for the choice of Language go through https://www.uniassignment.com/essay-samples/information-technology/the-factors-influencing-choice-of-programming-language-information-technology-essay.php

GPU programming in java [closed]

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 7 years ago.
Improve this question
I want to improve a JAVA program performances using GPU programming.
After some research on the internet I found that it is possible if i use jcuda or jocl, but the problem is that the kernel code must be written in C in both cases.
and the algorithm that i want every thread to execute is very complicated to be written in C (it does some computations to know if there will be an accident between two aircrafts) so an object-oriented language is necessery.
Is there a solution ? or must we translate the whole project to C++ ?
Thanks for your help !
Simple rule: if it needs object orientation, it looses its performance. Even if you are using GPU acceleration.
I would advise you to identify the parallel parts of your program code. You do not have to transfer all of your algorithm to the GPU device. Is there any aspect of paralellization, e.g. arrays or grids that are filled?
What kind is your simulation message exchange? Is it explicit, i.e. sending messages around your kernels, or implicit via synchronization.
You should at least give us some more information about you algorithm and its data layout.

Pointer manipulation in java [closed]

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
What are the reasons for restricting Java not to support Pointer Manipulations?
One reason is improved security. When Java doesn't allow pointers, the programmer is not allowed to freely step around in the computer memory. You also get rid of the C/C++ problem "undefined behavior". The rule of not having pointers in Java is also consistent with the way methods are supposed to be called in Java compared to C/C++ (call by reference).
See if you have pointers with you you are free to access physical memory locations that may be used by another process.Which will let you change content at that location corrupting the data used by another process. Pointer therefore pose issues of security and data corruption.
Hacking other process's memory is not at all a good idea.

Is there any ways in C,C++ to control the memory ram,registers according to our need? [closed]

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
Are there any ways in C and C++ to control the memory ram and registers according to our need? Eg. movement of data in ram from one location to other, changing values in registers, etc?
Is it possible in Java???
For memory management you should consider using a Memory Pool. Link.
Though you shouldn't be reinventing the wheel. Use a library instead that provides a clean templated interface to memory pools. Avoid malloc and memcpy as much as possible.
If you wan't to play with the registers you can include assembly code. Link.
I am not sure to understand your question, which is operating system, processor, and compiler specific.
With recent GCC you could do some of it (for instance, reserve registers to avoid them being used). And you could also customize the compiler (e.g. with MELT) to suite more needs. But such a customization means at least weeks of efforts.
You could also make a new backend in GCC (but this means months of work)
And recent standard C++11 library has notably std::allocator and a lot of memory management related stuff.

Categories

Resources