Previous in Forum: AutoCad Architectural Desktop 2007 & Norton   Next in Forum: Firewall Security
Close
Close
Close
2 comments
Rate Comments: Nested
Active Contributor

Join Date: May 2007
Posts: 11

Reentrant and recurssive routine.

11/01/2007 11:11 PM

What is reentrant routine / programme? Is recurssive routine any different?

Are any special features needed on a processor to implement?

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#1

Re: Reentrant and recursive routine.

11/02/2007 6:34 AM

This explanation is based on a singular app system like DOS and may not apply to multi tasking systems.

Recursive

A recursive program directly or indirectly calls itself. It is typically used for sorting.

the initial sort instruction is broken up into smaller chunks and processed by the same code. Each level have to keep track of its own data (usually start and end counters).

Reentrant

A program is reentrant if it can continue with its original task on return from an external interruption. almost any program can be made reentrant by the interrupting program by saving registers (internal CPU memory) and other status markers.

Typically a TSR (terminate stay resident) program has to ensure compatibility.

A TSR usually watched the keyboard or timer interrupt to activate itself. It then save the registers & status in the stack and install its own requirements. on exit it then has to save his own and restore the previous registers and status.

With multi tasking the opp system can perform this tasks for you.

__________________
Never do today what you can put of until tomorrow - Student motto
Register to Reply
Guru

Join Date: Sep 2006
Posts: 4513
Good Answers: 88
#2
In reply to #1

Re: Reentrant and recursive routine.

11/03/2007 11:11 AM

Your explanation is fine and doesn't need to be qualified on the basis of what operating system is in effect. You done good, pardner!

To our OP: Here is a brief example of a recursive function (programs are typically not recursive; recursion typically applies at the function level). This function computes the factorial of a number:

unsigned int factorial(unsigned int n) {
if (n <= 1) return 1;
return n * factorial(n-1);
}

Register to Reply
Register to Reply 2 comments

Previous in Forum: AutoCad Architectural Desktop 2007 & Norton   Next in Forum: Firewall Security
You might be interested in: Video Processor Boards, Cell Processors, Core Modules

Advertisement