Why do we write some part of os in assembly and some part in high level language like c? [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
In implementing operating system except very small part is written in assembly while most part is written in high level languages such as C/c++
What is the part that is written in assembly and why do we write it and why most of the code is written in high level languages

First, I am not sure that C qualify as a high level language (IMHO, it is a low level one; Haskell, Ocaml, ... are higher level than C).
Then, not everything inside an operating system kernel is implementable in portable C. Hardware dependent stuff (interrupt handling, scheduling, paging, access to hardware I/O ports ...) usually requires some assembly code.
(You could perhaps embed the code with asm keyword in C, but that does not count as portable C).

Related

fortran openmp lapack ZGEEV [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
is it possible to multi thread subroutines? I like to use openmp to run ZGEEV subroutine out of the lapack module on mutiple cores to fast things up. Is that even possible?
Yes in this case. LAPACK uses BLAS to get performance, and there are a number of efficient, multithreaded versions of BLAS (e.g. MKL, ACML, ATLAS). So you can use the threads at that level to get improved performance, though I must say that in my experience speed up is limited for diagonalisers.
More generally, though, you will have to parallelise the code yourself. In this case you get lucky because threaded versions of the important layer already exist.

CPU caches aware C++ / C programming [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was going through Scott Meyer's podcast on CPU CACHES AND WHY YOU CARE It seems this will make code run faster, is there any open source where such coding is done for reference.
Or anybody has example of design of data structures/algorithms based on CPU caches aware
Sure, the entire Linux kernel is implemented to be cache-aware.
For more details there is highly recommended paper What Every Programmer Should Know About Memory.
Linear algebra is sensitive to cache problems. The BLAS subroutines allow one to abstract away from these concerns

convert c++ libraries to objective-c [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Now I am porting c++ game to objective-c.
The source code uses some dlls such as "malloc.h" and this is the standard dll of C++ so it
cannot be included in objective-c.
What is the best way to overcome this problem.
I hope your help.
Thanks.
To convert code from one language to another, you need to have at basic working knowledge of both languages and platforms involved. It sounds as if both your C/C++ and Objective-C knowledge is too rudimentary for you to undertake this task. I'd recommend you take a short course and work on small projects in both languages to gain some experience so that you'll be qualified to perform this translation.

Generating word library - C or C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I need to create a simple application, but speed is very important here. Application is pretty much simple.
It will generate all available chars by saving them to text file. User will enter length that will be used for generating so the application will use recursive function with loop inside.
Will C be faster then C++ in this matter, or it does not matter?
Speed is very important because if my application needs to generate/save to file 10 million+ words.
It doesn't really matter, chances are your application will be I/O bound rather than CPU bound unless you have enough RAM to hold all that in memory.
It's much more important that you choose the best algorithm, and the best data structures to back that algorithm up.
Then implement that in the language you're most familiar with. C++ has the advantage of having easy to use containers in its standard libraries, but that's about it. You can write slow code in both, and fast code in both.

c++ like languages [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I think C++ is one of the best known programming languages of all time, especially for low level programming stuff, but what other languages are a bit like C++ in means of capabilities?
edit: I want compiled, low level programming languages. Not languages like java.
edit: What I meant with c++ like language is this: A compiled, low level language, suitable for high performance applications, it doesn't have to be oop, but it should have similar capabilities as C++ (e.g. OS programming). I hope this makes my question more clear.
http://en.wikipedia.org/wiki/D_%28programming_language%29