What Data Structures are available in the Linux Kernel [closed] - data-structures

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
Is there a list somewhere of all the major generic data structures used in the Linux Kernel and as a side bonus major places they're used?
What I mean by "generic data structures" is things like doubly linked lists, hash lists, timer wheels, etc.
Also, which ones are considered part of the internally provided api available to modules?
Edit
In the linux/lib directory I see some promising leads...
bitmap.c
plist.c
prio_heap.c
prio_tree.c
radix-tree.c
rbtree.c

From what I remember the linux kernel comes with implementations of Radix Tree and Red-Black Tree.

A relevant LWN article: Linux kernel design patterns - part 2

So, the best way to find out about kernel data structures is via the header files normally found at /usr/include. A thorough examination of these can be found in in this free on-line resource as well as many other sources:
Kernel Architecture
Two excellent books are:
Linux Kernel Architecture
Understanding the Linux Kernel

Related

Parallel computing: from theory to practice [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 5 years ago.
Improve this question
I studied how to optimize algorithms for multiprocessor systems. Now I would understand in main lines how these algorithms can be transformed into code.
I know that exist some libraries MPI based that helps the developement of software portable to different type of systems, but is right the word "portable" that makes me confused: how the program can be authomatically adapted to an arbitrary number of processors at runtime, since this is an option of mpirun? How the software can decide the proper topology (mesh, hypercube, tree, ring, etc)? The programmer can specify the preferred topology through MPI?
you start the application with a fixed number of cores. Thus, you cannot automatically adapted to an arbitrary number of processors at runtime.
You can tune your software to the topology of your cluster. This is really advanced and for sure not portable. It only makes sense if you have a fixed cluster and are striving for the last bit of performance.
Best regards, Georg

How do Hardware Description Languages differ from General Purpose languages at the low level? [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 6 years ago.
Improve this question
Question:
How do Hardware languages (HDLs) differ from general purpose languages such as Python, Java, etc. In particular, what is the primary trade-off that causes general purpose languages to be sub-optimal for FPGA's when compared to VHDL and Verilog?
Context:
I'm a programmer but definitely work at a high level of abstraction such as JavaScript, tinkering with API's, etc. My low-level knowledge is very limited but I am playing around with an FPGA and have some novice questions that I cannot solve with Google or Wikis.
Considering I am a novice, please do not vote harshly against this post. Just state your suggestions for the question and I will happily revise! :)
Example:
For example, why isn't everyone just coding FPGAs and ASICs with Python or C# instead of Verilog or VHDL? I understand that there are some Python libraries, but I have read that they are limited in their viable use-cases. I would greatly appreciate someone shining some light on why HDLs are necessary and beneficial and why general purpose languages are not optimal in comparison for these scenarios.
Thanks in advance!
This is a broad opinionated question, but I think there is a short answer. In some sense, they are all programming languages, i.e text descriptions that gets compiled into a set of machine instructions to be executed on a host machine(software).
But an HDL is also a text description that gets compiled into a set of machine instructions to build another machine (hardware).
Technically, any programming language could be used to describe hardware (SystemC in C++ as an example), Verilog and VHDL were specifically developed to model and simulate hardware most efficiently.

Do any computer languages not use a stack? [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 8 years ago.
Improve this question
Do any computer languages not use a stack data structure to keep track of execution progress?
Or is the use of this data structure an emergent requirement stemming from something inherent to most computer languages or turing machines?
With a traditional "C-style" stack, certain language features are difficult or impossible to implement. For example, closures can't easily be implemented with a traditional stack because closures require a pointer to an old activation record to work correctly and that memory is automatically reclaimed in a C-style stack. As another example, generators and coroutines need their own memory to store local variables and relative offset information and therefore can't easily be implemented if you use a standard stack implementation.
Hope this helps!

Does my network have shared or distributed memory [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 8 years ago.
Improve this question
Now I have some code that I would like to parallelize. The easiest thing would be to use openmp which will take advantage of the multiple processors and their cores and their shared memory. I have access to a network that I use for number crunching. I don't know if the memory on it is shared or distributed. How can I find this out? If it is shared then I can easily use openmp and it will work. I do less /proc/cpuinfo and I see that I have 8 processors available on the network. and I do less/proc/meminfo and it tells me I have 32000mega bytes of memory.
If you are using OpenMP you are probably writing your software to your machine only, as it is targeted on making the use of parallel programming transparent to the user. You can use OpenMP on a cluster together with MPI or with some OpenMP extension to make the many computers of the network appear to your OpenMP program like a single one.

What is the name of this software design behavior? [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 6 years ago.
Improve this question
When a software has a set of functionality where some of the functionality is provided with multiple implementations and the software automatically decides which one to use. So for instance:
An image editor that has image effects and some its effects like Blur, Median, etc is provided with both CPU and GPU implementations but not directly exposed to the user as options but rather the software decides which one to use based on the user's hardware.
Or in another case where the software chooses which sorting algorithm to use based on the data it has on the items to sort.
I guess this only happens in performance related features.
But what's the name of this feature/idea when a software has this workflow?
Is it called transparent execution? Or context sensitive? I seem to recall a term used to describe this behavior.
EDIT: Btw I am also interested in hearing the marketing term for this? Like ProgramX supports transparent execution.
This is strategy pattern.
You pass the same object to multiple implementations where the difference is the algorithm. This is a classic case of strategy pattern.
Sounds like the facade design pattern, from the GOF book page 185:
Provide a unified interface to a set
of interfaces in a subsystem. Facade
defines a higher level interface that
makes the subsystem easier to use.

Resources