Tips on using EMan
The following are some do's and don'ts for EMan:
- Eman callback procedures or methods must return quickly.
You cannot wait for long periods of time to return from the callbacks. If
such long delays occur, then the application may not notice some subsequent
events in time to process them meaningfully (for example, a timer event
may not be noticed until long after it occurred).
- It follows from the previous tip that you should not
do independent "select" system calls on file descriptors while inside a
callback. (This applies to sockets and message queues, as well.) In general,
a callback should not do any blocking of system calls. If an application
must do this, then it must be done with a small timeout value.
- Since EMan callbacks must return quickly, no callback
should wait on a semaphore indefinitely. If a callback has to obtain some
semaphores during its processing, then the callback should try to acquire
all of them at the very beginning, and should be prepared to abort and return
to EMan if it fails to acquire the necessary semaphores.
- EMan callback methods are called using name-lookup
resolution. Therefore, the parameters to an EMan registration call must
be such that the class object of the object parameter must be able to provide
a pointer to the method indicated by the method parameter. Although this
requirement is satisfied in a majority of cases, there are exceptions. For
example, if the object is a proxy (in the DSOM sense) to a remote object,
then the "real" class object cannot provide a meaningful method pointer.
Also note that, when somDspatch is overridden, the effect of such
an override will not apply to the callback from EMan. Do not use a method
callback in these situations; instead, use a procedure callback.
[Back: Using EMan from other languages]
[Next: Limitations]