1 Answer

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.

Like 0 like

Related Questions

Description : What are counting semaphores and resource semaphore?

Last 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?

Last 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. 

Last 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

Last 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 : 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 final value of semaphore will be: (1) 0 (2) 1 (3) -1 (4) -2 

Last Answer : Answer: 1

Last 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.

Last 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.

Last 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.

Last 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 : A lumberyard charges $ 1 per cut to trim boards. Bob buys a 12-ft board and wants it out into twelve 1-ft pieces. How much will he be charged for the cutting? The correct answer is $11.

Last Answer : It takes 11 cuts to cut a 12 foot board into 12 pieces. It always takes 1 less cut than the number of pieces wanted. If you want 2 pieces, you cut once. If you want 3 pieces, you cut twice. Etc.

Description : An intuitive manager could best be described as one who: A)uses scientific problem solving B)eliminates uncertainty in decision making C)searches out facts and data systematically D)uses an orderly approach to gathering information E)uses personal knowledge and experience to make decisions

Last Answer : E)uses personal knowledge and experience to make decisions

Description : Having multiple perceptrons can actually solve the XOR problem satisfactorily: this is because each perceptron can partition off a linear part of the space itself, and they can then combine their results. ... have to be explicitly hand-coded d) False - just having a single perceptron is enough

Last Answer : c) True – perceptrons can do this but are unable to learn to do it – they have to be explicitly hand-coded

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

Last Answer : A) Scientific

Description : Research Does Not means to; a. Search again b. Examine carefully c. Create problem d. Method of problem solving

Last Answer : c. Create problem

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 ... problems so that corrective action can be taken before the problem grows. ; (d) None of the above 

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

Description : This passage may be summarized as (1) In career planning, it is important to involve oneself in cultural/sports activities as much as working hard or acquiring new skills.' (2) Before ... A good career choice results when you follow traditional professions and move along a well-planned path.

Last Answer : (2) ‘Before making a career choice, one should learn to prioritize career options and use one's personality, interests, abilities, aspirations, strengths and weaknesses to plan and decide the most viable option

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

Last Answer : C) A nomenclature for cataloguing experience 

Description : What is meant by embedded Linux?

Last 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 : If Master Foods Ltd knows that its market share in Ireland has dropped 13 percent in the first quarter of the year but does not know what might have contributed to this ... research process? A)hypothesis development B)symptom identification C)problem identification D)data interpretation

Last Answer : C)problem identification

Description : Chrysler's Chief Executive Officer is the company's spokesperson. His message has focused on concern for customers and product quality. Which aspect of implementing the marketing concept does ... concept by top management D)Development of an information system E)Restructuring of the organisation

Last Answer : C)Endorsement of the marketing concept by top management

Description : Firms that truly adopt the marketing concept develop a distinct organisational culture based on a shared set of beliefs that make __________ the pivotal point of the firm's decisions ... beating competitors B)increasing market share C)customers' needs D)marketing implementation E)marketing control

Last Answer : C)customers' needs

Description : …………… can be defined as most recent and perhaps the most comprehensive technique for solving computer problems. A) System Analysis B) System Data C) System Procedure D) System Record

Last Answer : A) System Analysis

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

Last 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 : In programming, how many steps are involved in solving a problem on a computer?

Last Answer : Four.

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 : With the help of neat diagram. explain the concept and principle used in electroplating. 

Last 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 DMA controllers are special hardware embedded into the chip in modern integrate processor that ____and_____ to the system; a. Data transfer b. arbitrate access c. Both A and B d. None of these

Last Answer : c. Both A and B

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

Last 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

Last Answer : D .All of the above

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

Last Answer : B. Digital camera

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

Last 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

Last 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

Last Answer : B. Digital camera 

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

Last Answer : (B) 335 K

Description : For solving an assignment problem, which method is used? a. British b. American c. German d. None of the above

Last Answer : B. american

Description : . The method used for solving an assignment problem is called a. Reduced matrix method b. MODI method c. Hungarian method d. None of the above

Last Answer : . c. Hungarian method

Description : While solving an assignment problem, an activity is assigned to a resource through a square with zero opportunity cost because the objective is to a. Minimize total cost of assignment b. Reduce the cost of ... to zero c. Reduce the cost of that particular assignment to zero d. All of the above

Last Answer : c. Reduce the cost of that particular assignment to zero

Description : 60. While solving a LP problem, infeasibility may be removed by a. Adding another constraint b. Adding another variable c. Removing a constraint d. Removing a variable

Last Answer : c. Removing a constraint

Description : 7. Who defined Operations Research as scientific approach to problem solving for executive management? a. E.L. Arnoff b. P.M.S. Blackett c. H.M. Wagner d. None of the above

Last Answer : c. H.M. Wagner

Description : The principle of time sharing is 1 large numbers of users direct access to the computer for problem solving 2 large number of user for file sharing 3 both of above 4 none

Last Answer : 1 large numbers of users direct access to the computer for problem solving

Description : A problem solving approach (algorithm) to find a satisfactory solution where finding an optimal or exact solution is impractical or impossible. Heuristic A. Algebraic B. Hyroglyphics C. Hypertext

Last Answer : C. Hypertext

Description : Which of the following is NOT characteristic of a nursing research? a. Development of theories, principles, and generalizations b. Uses chaotic method of problem-solving c. Requires full skill of writing report d. Involves precise observation and accurate description

Last Answer : b. Uses chaotic method of problem-solving

Description : The consumer is MOST likely to use limited problem solving for : A)Laundry detergent B)Toothpaste C)A new car D)A blender E)A foreign holiday

Last Answer : D)A blender

Description : Which of the following is MOST likely require a consumer to use extended problem solving? A)Stereo equipment B)Shaving cream C)Cereal D)Kitchen utensils E)Gasoline

Last Answer : A)Stereo equipment

Description : .................... is the popular method for solving an assignment problem. a. Hungarian Method b. Enumeration Method c. Simplex Method d. None of the above

Last Answer : a. Hungarian Method

Description : The Hungarian method for solving an assignment problem can also be used to solve: a. A transportation problem b. A travelling salesman problem c. A linear programming problem d. Both a and b

Last Answer : b. A travelling salesman problem

Description : The method used for solving an assignment problem is: a. Reduced matrix method b. MODI method c. Hungarian method d. None of these

Last Answer : c. Hungarian method

Description : Who defined Operations Research as scientific approach to problem solving for executive management. a. E L Arnoff b. H M Wagner c. Churchman d. None of these

Last Answer : b. H M Wagner

Show MoreNext Page → ← Prev Page