Friday 16 June 2017

Linux Kernel

 In Linux thread is a process which actual share some resources with other process . Every thread has a unique task_struct.creating thread also created by using the clone sys call except some flags for sharing the data like file system , signal handler,open files also set.  Flags are used to specify that which resources are shared between parent and child process or thread.E.g clone(CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, 0);
The task_struct is a large data structure around 1.7 Kb on a 32 bit machine. This structure maintain all the information about a process and thread_info structure for thread information.

Different states in Linux Process:

In linux a process can be in one of the following state. 1) TASK_RUNNING :- This state specify that process is either running or in ready state and waiting in runqueue . 2) TASK_INTRUPTTIBLE:- This condition states that the task is in sleeping state and waiting for some event to occur. When this condition occurs task comes in TASK_RUNNING state. 3) TASK_UNINTRRUPTIBLE:- This state is similar as previous state but in this state process does not wait for any event to occur.

Interrupt latency and how can we decrease it?

- ISRs being simple and short.
- Interrupts being serviced immediately
- Avoiding those instructions that increase the latency period.
- Also by prioritizing interrupts over threads.
- Avoiding use of inappropriate APIs.

critical sections?

Critical section allows the process to run in an area that is defined by that process only. It is a sequence of instructions that can be corrupted if any other process tries to interrupt it.The processes exit from the critical section as soon as they finish the execution so that the chances can be given to other processes that are waiting for their chance to come.

 Watchdog timer in embedded system

Watchdog timer is a tool that is used in embedded system and having a long-fuse that runs several seconds. Watchdog timer includes the automated timing control that count down the number from max to 0 and when the counter reaches the zero, this WDT reset the micro-controller that gets turned off when the timer was in initial phases. Watchdog require the user to put some value before it runs out of time and reset the whole process as this can harm the data and the system.

 

No comments:

Post a Comment