A watchdog timer (or computer operating properly timer) is a computer hardware timing device that triggers a system reset if the main program, due to some fault condition, such as a hang, neglects to regularly service the watchdog. The intention is to bring the system back from the hung state into normal operation.
In computer science, a semaphore is a protected variable or abstract data type which constitutes the classic method for restricting access to shared resources such as shared memory in a parallel programming environment. A counting semaphore is a counter for a set of available resources, rather than a locked/unlocked flag of a single resource.
Mutual exclusion (often abbreviated to mutex) algorithms are used in concurrent programming to avoid the simultaneous use of a common resource, such as a global variable, by pieces of computer code called critical sections.
Yes structures can be passed by value. But unnecessary memory wastage.
When a array is passed to a function, the array is internally changed to a ‘pointer’. And pointers are always passed by reference.
Advantage: Macros and Inline functions are efficient than calling a normal function. The times spend in calling the function is saved in case of macros and inline functions as these are included directly into the code.
Disadvantage: Macros and inline functions increased the size of executable code.
Difference in inline functions and macro
1) Macro is expanded by preprocessor and inline function are expanded by compiler.
2) Expressions passed as arguments to inline functions are evaluated only once while _expression passed as argument to inline functions are evaluated more than once.
More over inline functions are used to overcome the overhead of function calls. Macros are used to maintain the readability and easy maintenance of the code.
It is illegal to declare a recursive function as inline. Even a function is declared as inline compiler judges it to be inline or not. Many compilers can also inline expand some recursive functions; recursive macros are typically illegal.
Scope of static variable is within the file if it is static global. Scope of static variable is within the function if variable is declared local to a function.
But the life time is throughout the program
In computing, a process is an instance of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently.
A single process may contain several executable programs (threads) that work together as a coherent whole. One thread might, for example, handle error signals, another might send a message about the error to the user, while a third thread is executing the actual task of the..
In computing, an inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores basic information about a regular file, directory, or other file system object.