| OCR Text |
Show 88 both backtracking and task migration to avoid conflicting changes to rep. An idle process migrates a new task from the process whose rep choice point was created at the lowest execution level. Finding this process requires examining the information blocks of all active processes. Since the values of rep for any process could change during this examination, all information blocks must be locked to ensure exclusive access. In early implementations of Boplog, this approach proved to be disastrous, since idle processes monopolized the information blocks, prohibiting effective task migration. A solution which resulted in far better performance involved taking the following steps to find the correct migration process: 1. Without locking any information blocks, poll the information blocks to find the process with the lowest-level rep choice point. 2. Lock the information block of the process with the lowest-level rep choice point. 3. If the level is now the same as it was during the polling step, migrate from this choice point. 4. If the level is now different, unlock the information block and return to the first step. 4.5.2 Reporting Solutions How should solutions be reported in an OR-parallel execution? How this question is answered depends largely on how the system is used. If it is embedded in a more conventional sequential logic programming system such as Prolog, it would be convenient if all solutions could be gathered together in a Prolog data structure, such as is done for Prolog's bagof predicate. This solution has been proposed by Ciepielewski and Haridi [8] and seems to be the most useful approach. Bop log does not currently support the use of bagof. Instead, as solutions are found, the variables in the top-level query are completely dereferenced and copied into a solution buffer which is shared by all Boplog processes. Because this data area is write-once, no locking is required; new solutions are appended to the end of the list of existing solutions by atomically incrementing a pointer to the end of the buffer. |