Avoiding Deadlock in Callbacks

Callbacks can easily manifest the phenomenon of distributed deadlock. Consider the system shown in Figure 9.1, where a client with a callback object makes an invocation on a CORBA object in a server. Both client and server are single threaded.

Figure 9.1. Deadlock in a system using callbacks.

Because the client is single threaded, it uses an event loop, as shown in Listing 9.1 and Listing 9.2. In the course of executing the process_user_input() function, the client makes a remote invocation on the server’s CORBA object. Consider what happens if the server calls back on the client’s CORBA object while processing ...

Get Pure CORBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.