search
person

1 Answer

A semaphore is called binary semaphore when its value is 0, it is assumed that it has been taken (or accepted) & when its value is 1, it is assumed that it has been released & no task has taken it yet.
An ISR can release the token. A task can release the token as well accept the token or wait for taking the token.

Shared data problem solutions:

One solution is atomic queue operation for solving the shared data problem.
1.Use modifier volatile with a declaration for a variable that returns from the interrupt. This declaration warns the compiler that certain variables can modify because the ISR does not consider the fact that the variable is also shared with a calling function.
2.Use reentrant functions with atomic function instructions in that part of a junction that needs its complete execution before it can be interrupted.
3.Put a shared in a critical queue. A function that requires the value of this variable always deletes it from the queue front, and another function, which inserts the value of this variable. always does so at the queue back.
4.Disable the interrupts before a critical section starts executing & enable the interrupts on its completion it is a powerful drastic option. An interrupt even is of higher priority than the present critical function gets disabled.

Shared-Data Problems
Void Task1 (void)
{
:
vconterErrors(9);
:
}
void Task2 (void)
{
:
vcontErrors(11);
:
}
static int cErrors;

void vconutErrors (int vNewErrors)
{
cErrors += cNewErrors:
}

Fig. Tasks can share code

The above fig shows a bug in the code. Here both task1 and task2 call vcontErrors. This is a perfectly valid thing to do in an RTOS. Any or all of the tasks can share as many subroutines as is convenient.
The difficulty with the program is that because both Task1 and Task2 call vcontErrors and since vcontErrors uses the variable cErrors is now shared by the 2 tasks.
If task1 calls vcontErrors, and if the RTOS then stops Task1 and runs Task2 which then calls vcontErrors, the variable cErrors may get corrupted in just the same way as it would if Task2 were an interrupt routine that had interrupted Task1.

Reentrancy:
Reentrant functions are functions that can be called by more than one task and that will always work correctly, even if the RTOS switches from one task to another in the middle of executing the function.
The 3 rules to decide if a function is reentrant are:
1. A reentrant function may not use variables in a nonatomic way unless they are stored on the stack of the task that called the function or are otherwise the private variables of that task that called the function or are otherwise the private variables of that task.
2. A reentrant function may not call any other functions that are not themselves reentrant.
3. A reentrant function may does not use the hardware in a nonatomic way.

thumb_up_alt 0 like thumb_down_alt 0 dislike

Related questions

Description : What are counting semaphores and resource semaphore?

Answer : If a task tries to take the semaphore when the integer is equal to zero, then the task will block. These semaphores are called counting semaphore. Some system offer semaphore that can be ... , but they cannot be used to communicate between two tasks. Such semaphores are called resource semaphore.

Description : Explain the concept of JIT and how does it help the manufacturing system to improve productivity?

Answer : Concept of JIT: [1] JIT is a Production methodology which aims to improve overall productivity through elimination of waste and which leads to improved quality. [2] JIT concept was ... ] It improves customer satisfaction [14] It improves working condition and relation between employees. 

Description : There are three processes P1, P2 and P3 sharing a semaphore for synchronising a variable. Initial value of semaphore is one. Assume that negative value of semaphore tells us how many processes are waiting in queue. Processes access the semaphore in following order: (a) P2 needs to access (b) P1 needs to access (c) P3 needs to access (d) P2 exits critical section (e) Pi exits critical section The final value of semaphore will be: (1) 0 (2) 1 (3) -1 (4) -2 

Answer : Answer: 1

Description :

Answer : Common computation models: Sequential program model Statements, rules for composing statements, semantics for executing them Communicating process model ... Object-oriented model For breaking complex software into simpler, well-defined pieces

Description :

Answer : Various features of Linux that are used in embedded systems are as follows : Linux is multiuser operating system. Linux is open source and free. Linux can be ... Linux supports handling of errors. Real-time Linux supports the group scheduling functions.

Description :

Answer : Liquid Crystal Display:-An LCD is a low-cost, low power device capable of displaying text and images. LCD's are extremely common in embedded systems since such system often does not have video monitors ... toggles the enables bit and acts as a delay so that the command can be processed and executed.

Description :

Answer : The main characteristics of an embedded system are:1. Single functioned2. Tightly constrained3. Reactive and real time1. Single functioned:An embedded system usually executes a specific program repeatedly.Ex. Pager ... computer user. But it doesn't result in a system failure.Ex. Digital camera chip

Description : Define embedded system.

Answer : An embedded system is nearly any computing system other than a desktop computer. Embedded systems are hard to define because they cover such a broad range of electronic devices. It has three main components: 1. Hardware 2. Main application software 3. Real time operating system

Description :

Answer : Shared memory :For sharing of data faster and communication between programs, we use shared memory. Shared memory can be used with multiprocessors and single processors. Means Program ... No resource preemption4. Circular waitIf the four conditions occur simultaneously then the deadlock occurs.

Description : If you are employing scientific method for solving a problem and interpretation of the results, then this process is called Options: A) Scientific B) Self-satisfying C) Complementary to personal objectives D) None of the above

Answer : A) Scientific

Description : A problem solver is a style of problem solving reflected by the manager (a) Who confronts the problem, reacts to it, and makes those changes necessary solve it. (b) Who notices a problem and does not react. (c) Who actively looks at situations, searching for problems or anticipating possible problems so that corrective action can be taken before the problem grows. ; (d) None of the above 

Answer : (a) Who confronts the problem, reacts to it, and makes those changes necessary solve it. 

Description : Language is best thought of as Options: A) A biological (instinctive) development B) A system of symbols for effective problem-solving C) A nomenclature for cataloguing experience D) A medium for self-enhancement

Answer : C) A nomenclature for cataloguing experience 

Description : A thread is usually defined as a light weight process because an Operating System (OS) maintains smaller data structure for a thread than for a process. In relation to this, which of the following statement is correct? (A) OS maintains only scheduling and accounting information for each thread. (B) OS maintains only CPU registers for each thread. (C) OS does not maintain a separate stack for each thread. (D) OS does not maintain virtual memory state for each thread.

Answer : (B) OS maintains only CPU registers for each thread.

Description : "Life is a series of problem-solving opportunities. The problems you face will either defeat you or develop you depending on how you respond to them." - Rick Warren

Description : A specific editor has 200 K of program text, 15 K of initial stack, 50 K of initialized data, and 70 K of bootstrap code. If five editors are started simultaneously, how much physical memory is needed if shared text is used ? (A) 1135 K (B) 335 K (C) 1065 K (D) 320 K

Answer : (B) 335 K

Description : A digital multi meter is an example of an embedded system for A. Data communication B. Monitoring C. Control D. All of these E. None of these

Answer : B. Monitoring 

Description : What are the essential tight constraint/s related to the design metrics of an embedded system? A. Ability to fit on a single chip B. Low power consumption C. Fast data processing for real-time operations D .All of the above

Answer : D .All of the above 

Description : Which of the following is (are) example(s) of embedded system for data communication? USB Mass Storage device A. Network router B. Digital camera C. Music player D. All of these E. None of these

Answer : B. Digital camera 

Description : What is meant by embedded Linux?

Answer : Linux is the operating system if we use this operating system in embedded system devices then it is known as embedded Linux. Linux is open source and free.

Description :

Explain data transfer mechanism in I2C protocol. Compare it with CAN and USB protocol based on bit rate and area of applications.

Answer : I2C (Inter-Integrated Circuit): I2C stands for Inter-Integrated Circuit. I2C is a serial protocol. It was developed by Philips Semiconductor. I2C bus have two communication lines. One is serial data ( ... Mbps this is used for lower speed devices. Using USB we can connect upto 127 devices.

Description : With the help of neat diagram. explain the concept and principle used in electroplating. 

Answer : Process of Electroplating:-  A DC current passed through a solution of chemical compound then the solution can be dissociated into its constituent's parts & deposition of metal takes ... its salt. Again it dissociates & process is continued till pure metal goes into solution.

Description : The important characteristics of the survey method is Options: A) It is capable for collecting data from a large group (population) simultaneously B) Here the work is being carried out on pre-determined problem C) The aims of this method are fixed and specific D) All the above statements are correct

Answer : D) All the above statements are correct 

Description : It is not possible to tickle yourself. Even the most ticklish among us do not have the ability to tickle ourselves. The reason behind this is that your brain predicts the tickle from information it already has, like how your fingers are moving. Because it knows and can feel where the tickle is coming from, your brain doesn’t respond in the same way as it would if someone else was doing the tickling.

Description : The solution is to gradually become free of societal rewards and learn how to substitute for them rewards that are under one's own powers. This is not to say that we should abandon every goal endorsed by society; rather, it means that, in addition to or instead of the goals others use to bribe us with, we develop a set of our own. 

Description : The question to be answered by factorial analysis of the quantitative data does not explain one of the following (A) Is ‘X’ related to ‘Y’ ? (B) How is ‘X’ related to ‘Y’? (C) How does ‘X’ affect the dependent variable ‘Y’ at different levels of another independent variable ‘K’ or ‘M’ ? (D) How is ‘X’ by ‘K’ related to ‘M’?

Answer : (D) How is ‘X’ by ‘K’ related to ‘M’?

Description : Which of the following statement(s) is/are FALSE in the context of Relational DBMS ? I. Views in a database system are important because they help with access control by allowing users to see only a particular subset of the data in the database. II. E-R diagrams are useful to logically model concepts. III. An update anomaly is when it is not possible to store information unless some other, unrelated information is stored as well. IV. SQL is a procedural language. (A) I and IV only (B) III and IV only (C) I, II and III only (D) II, III and IV only

Answer : (D) II, III and IV only

Description : How many US senators does Utah have? a. 1 b. 2 c. 3 d. 4

Answer : Correct Answer: b

Description : Abstraction and encapsulation are fundamental principles that underlie the object oriented approach to software development. What can you say about the following two statements? I. Abstraction allows us to focus on what something does without considering the complexities of how it works. II. Encapsulation allows us to consider complex ideas while ignoring irrelevant detail that would confuse us. (1) Neither I nor II is correct. (2) Both I and II are correct. (3) Only II is correct. (4) Only I is correct.

Answer : (1) Neither I nor II is correct.

Description : Explain the need to consider following factors in design matrix of embedded system: (i) Processor (ii) Memory (iii) Power (iv) Non- recurring engineering cost.

Answer : 1. Processor: Selection of processor depends upon amount of processing power and the register width required. Powerful 8bit, 16 bit, 32 bit & 64bit processors are available. The clock speed ... system is designed any number of units can be manufactured without incurring any additional design cost.

Description : List the steps involved in simple problem solving technique.

Answer : i. Goal formulation ii. Problem formulation iii. Search iv. Solution v. Execution phase

Description : Which of the following is / are not direct method to solve intergroup conflicts (a) Problem solving ; (b) Domination by the management ; (c) Removing key figures in conflict (d) Persuasion

Answer : (d) Persuasion

Description : A group of employees with expertise in a variety of specialty areas who are brought together to work on a project or specific activity is a: (a) Cross functional team ; (b) Self-managed team ; (c) Virtual team ; (d) Problem-solving team

Answer : (a) Cross functional team ;

Description : Which of the following qualities did the University of Michigan Institute for Social Research find in effective supervisors? (a) Participative problem solving. (b) Delegation of authority. (c) An interest and concern for subordinates. (d) All the above. [hint: A major research study was carried out at the University of Michigan Institute for Social Research where effective supervisors, measured along dimensions of group morale, productivity and cost reduction appeared to display all of those qualities mentioned above, together with high standards of performance.] 

Answer : (d) All the above. 

Description : Which of the following statement matches with that of Mouly? Options: A) Research is a process in which Exploratory procedure(method) has been employed B) The application of Scientific method foe experimentation and interpretation intellectually for solving the problems is called a research C) Research is an intensive formal and organised procedure D) Research can be defined in the form of study method of problem-solving

Answer : B) The application of Scientific method foe experimentation and interpretation intellectually for solving the problems is called a research

Description : Vygotsky theory implies Options: A) child will learn best in the company of children having IQ lesser than his/her own. B) collaborative problem solving C) individual assignments to each student D) after initial explanation, do not support a child in solving difficult questions

Answer : B) collaborative problem solving 

Description : A workshop is (A) a conference for discussion on a topic (B) a meeting for discussion on a topic. (C) a class at a college or a university in which a teacher and the students discuss a topic. (D) a brief intensive course for a small group emphasizing the development of a skill or technique for solving a specific problem.

Answer : (D) a brief intensive course for a small group emphasizing the development of a skill or technique for solving a specific problem. 

Description : In the Hungarian method for solving assignment problem, an optimal assignment requires that the maximum number of lines that can be drawn through squares with zero opportunity cost be equal to the number of: (A) rows or columns (B) rows+columns (C) rows+columns-1 (D) rows+columns+1

Answer : (A) rows or columns

Description : Define problem solving agent.

Answer : Problem solving agent is one kind of goal based agent, where the agent Should select one action from sequence of actions which lead to desirable states. 

Description : What is the term used for describing the judgmental or commonsense part of problem solving? A. Heuristic B. Critical C. Value based D. Analytical

Answer : A. Heuristic 

Description : What is the term used for describing the judgmental or commonsense part of problem solving? A. Heuristic B. Critical C. Value based D. Analytical E. None of the above

Answer : A. Heuristic 

Description : According to Robert Katz, when managers have the mental ability to analyze and diagnose complex situations, they possess _____________ skills. (a) Technical ; (b) Leadership ; (c) Problem-solving ; (d) Conceptual

Answer : ; (d) Conceptual 

Description : McGrath and Watson have defined research as Options: A) User of exploratory method B) A intellectual exploration C) Use of scientific method for analysis D) Problem-solving 

Answer : A) User of exploratory method

Description : Which of the following methods of teaching encourages the use of maximum senses? Options: A) Problem-solving method B) Laboratory method C) Self-study method D) Team teaching method

Answer : B) Laboratory method 

Description : A teacher can make problem-solving fun for students by doing all the following except Options: A) providing open ended material B) giving time for free play C) providing endless opportunities for creative thinking D) expecting perfection from the students while they are trying to do things by themselves.

Answer : D) expecting perfection from the students while they are trying to do things by themselves.

Description : The most important function of the teacher is to Options: A) Maintain a order B) Impart subject-matter C) Teach problem-solving techniques D) Guide pupil's growth

Answer : D) Guide pupil's growth 

Description : Which one is the highest order of learning? (A) Chain learning (B) Problem-solving learning (C) Stimulus-response learning (D) Conditioned-reflex learning 

Answer : (D) Conditioned-reflex learning

Description : Which of the following phrases is not relevant to describe the meaning of research as a process? (A) Systematic Activity (B) Objective Observation (C) Trial and Error (D) Problem Solving 

Answer : (B) Objective Observation

Description : Which of the following methods of teaching encourages the use of maximum senses? (A) Problem-solving method (B) Laboratory method (C) Self-study method (D) Team teaching method

Answer : (B) Laboratory method

Description : The convergence characteristic of the Newton—Raphson method for solving a load flow problem is (A) quadratic (B) linear (C) geometric (D) cubic 

Answer : The convergence characteristic of the Newton—Raphson method for solving a load flow problem is quadratic

Description : In relation to embedded Linux how TCP/IP networking is done? Explain network configuration.

← Prev Question Next Question →
editAsk a Question
...