ken@cs.cornell.edu (Ken Birman) (05/31/91)
A few people have asked me about "concealing" their use of ISIS in the context of an application that will present a well delineated interface to the external world and doesn't want to impact its callers in a significant way. For example, one place is doing a database interface module with a set of routines -- call them query(), update(), for simplicity. They want to use ISIS inside the implementation of this module without inflicting the ISIS environment (tasks, etc, etc) on their eventual users. The way to do this is to add one routine to your interface, "sweep()" and get people to promise to call it periodically. Then, code your module so that on the first invocation of an interface routine (any of the three of them in this example) you call isis_init. The sweep routine should call isis_accept_events(ISIS_ASYNC), and the query and update routines can safely call into ISIS in the usual way. Al use of ISIS threads, etc, would be concealed within ISIS in this example, and users of the package would simply not be aware that it makes use of ISIS. You might be worried about the case where you call query() and it blocks on an RPC-style broadcast or something, and nobody is around to call sweep(). The actual rule is that the sweep() routine would only need to be called when the user's application is active -- if you are blocked in ISIS, ISIS will keep itself alive. Now, in the limit, you can even hide the sweep interface. You could (in principle) use set_itimer to set up a periodic interrupt, every 250 milliseconds or so, and call isis_accept_events from this. If so, you should just be careful to only do this call if you are not already "inside" ISIS. I.e., when you enter query() or update(), set a flag "in_isis" to true. On the itimer interrupt, call isis_accept_events only if "in_isis" is false. Such a scheme completely conceals the use of ISIS from the users of the module. They see a normal UNIX world, normal UNIX processes, etc. -- Kenneth P. Birman E-mail: ken@cs.cornell.edu 4105 Upson Hall, Dept. of Computer Science TEL: 607 255-9199 (office) Cornell University Ithaca, NY 14853 (USA) FAX: 607 255-4428