Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3.8 Concurrency in Lisp The concept of future was popularized by R. Halstead's work on the language Multilisp for concurrent Lisp programming. Operationally, a future
3.8 Concurrency in Lisp The concept of future was popularized by R. Halstead's work on the language Multilisp for concurrent Lisp programming. Operationally, a future consists of a location in memory (part of a cons cell) and a process that is intended to place a value in this location at some time "in the future." More specifically, the evaluation of (future e) proceeds as follows: i. The location /that will contain the value of (future e) is identified (if the value is going to go into an existing cons cell) or created if needed. ii. A process is created to evaluate e. ii. When the process evaluating e completes, the value of e is placed in the location. I iv. The process that invoked (future e) continues in parallel with the new process. If the originating the location has been filled with the value of e. Other than this construct, all other operations in this problem are defined as in pure Lisp. For example, if expression e evaluates to the list (1 2 3), then the expression (cons 'a (future e)) produces a list whose first element is the atoma and whose tail becomes (1 2 3)when the process evaluating e terminates. The value of the future construct is that the program can operate on the car of this list while the value of the cdr is being computed in parallel. However, if the program tries to examine the cdr of the list before the value has been placed in the empty location, then the computation will block (wait) until the data is available 3.8 Concurrency in Lisp The concept of future was popularized by R. Halstead's work on the language Multilisp for concurrent Lisp programming. Operationally, a future consists of a location in memory (part of a cons cell) and a process that is intended to place a value in this location at some time "in the future." More specifically, the evaluation of (future e) proceeds as follows: i. The location /that will contain the value of (future e) is identified (if the value is going to go into an existing cons cell) or created if needed. ii. A process is created to evaluate e. ii. When the process evaluating e completes, the value of e is placed in the location. I iv. The process that invoked (future e) continues in parallel with the new process. If the originating the location has been filled with the value of e. Other than this construct, all other operations in this problem are defined as in pure Lisp. For example, if expression e evaluates to the list (1 2 3), then the expression (cons 'a (future e)) produces a list whose first element is the atoma and whose tail becomes (1 2 3)when the process evaluating e terminates. The value of the future construct is that the program can operate on the car of this list while the value of the cdr is being computed in parallel. However, if the program tries to examine the cdr of the list before the value has been placed in the empty location, then the computation will block (wait) until the data is available
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started