Mutex v/s Semaphore v/s Spinlock

Similarity – All of these are used for synchronization Difference Mutex provides one person to access a single resource at a time, others must wait in a queue. Once this person is done, the guy next in the queue acquires the resource. So access is serial, one guy […]

>GL: Question

>- fun(int, int); fun(char, char)Are they overloaded properly? – Using static variable in a member function? – Finding the common node of two link lists? – Implement BFS, DFS? – Inorder, preorder is DFS or BFS? – What is a heap? – Deleting a node in BST? – […]

>Signals in Linux

>- List of signals: $kill -l– You can’t handle SIGSTOP and SIGKILL. You can’t priorities which signal to handle.– Signals are generated by setting the appropriate bit in the task_struct’s signal field. If the process has not blocked the signal and is waiting but interruptible (in state Interruptible) […]

>Some useful questions

>- Access privileges for private functions in C++?– Controlling exclusive access to a variable with two processor and two threads?– Pattern substitution with sed?– What is md5?– When do you allocate memory for static variables?– Phases of compiler, AST?– When do we allocate storage for static?– Data hiding […]

>Bouquet of questions-3

>o How can you add attributes in gcc, e.g., changing function call way from cdecl to stdcall? GCC allows you to attribute your functions with __attribute__ macro.This macro allows you to write more readable, clean code. I liked, – __attribute__((destructor))– __attribute__((constructor))– __attribute__((warning(“Function definition is not found))) There are […]

>Bouquet of questions-2

>o What is a bus error? Bus refers to address bus and an error means passing an illegal address to the address bus. There are two signals that can be sent by kernel for an illegal address:– SIGBUS– SEGSEGV A SIGBUS is issued for an obvious wrong virtual […]