Synchronization Events
Events for synchronization
To allow for more advanced thread synchronization during parallel solves, AIMMS offers synchronization objects called events, which can be manipulated using the function listed in this table.
|
|
|
|
Creating events
Through the function GMP::Event::Create
you can create a new event,
while the function GMP::Event::Delete
deletes existing events. Using
the function GMP::Event::Set
you can notify AIMMS that an event has
occurred. The function GMP::Event::Reset
resets the event.
Waiting for events
Events are elements of the predefined set AllGMPEvents
, which, along
with the set AllSolverSessions
, is a subset of the predefined set
AllSolverSessionCompletionObjects
. As both the functions
expect a subset of the set AllSolverSessionCompletionObjects
as
their arguments, these functions can be used to wait for both solver
session completion and the occurrence of events.
Using events
You can use events, for example, to notify the main thread of execution in your model that you want a new mathematical program instance to be generated and solved asynchronously based on input data provided by a solver callback. AIMMS does not allow asynchronous solves to be started from within a callback itself.