Re: [HACKERS] CORBA STATUS - Mailing list pgsql-hackers

From Goran Thyni
Subject Re: [HACKERS] CORBA STATUS
Date
Msg-id 3829D9EF.AF03539C@kirra.net
Whole thread Raw
In response to Re: [HACKERS] CORBA STATUS  (Michael Robinson <robinson@netrinsics.com>)
List pgsql-hackers
Michael Robinson wrote:
> Goran Thyni <goran@kirra.net> writes:
> >AFAICS, POA assumes a threaded server while
> >PgSQL uses a traditional forking model.
>
> This is not the case.  The POA assumes a nestable, multiplexed call
> interface.  The POA server can receive multiple requests from multiple
> clients (or even multiple simultaneous requests from one client), and,
> if single threaded, is allowed to simply queue them and service each
> request in natural order.

OK,
I went on hearsay, got confused by the code.
Thank you for clearifying.

But the issue remains,
if you fork in a connection handler (after accept())
you got two servers competing on both connections.

I outline a model for how CORBA could be implemented
without rewriting the whole server and make it optional
for platforms not supporting CORBA.

Attached below is a first attempt with sketchy pseudo-code.
I hope it is understandable.

regards,
--
-----------------
Göran Thyni
On quiet nights you can hear Windows NT reboot!
mainloop()
{
  if (fork())
    {
      traditional_accept_fork_loop();
      kill_corba_server_and_exit();
    }
  else
    {
      corba_main_in_POA();
    }
}

corba_connection_handle()
{
  setup_IPC();
  if (!fork())
    {
      for (;;)
    {
      wait_on_IPC();
      runquery();
    }
    }
}

corba_request_handler()
{
  send_requset_on_IPC();
  wait_for_response();
  response_to_POA();
}


pgsql-hackers by date:

Previous
From: Bernard Frankpitt
Date:
Subject: Re: [HACKERS] Indent
Next
From: Bruce Stephens
Date:
Subject: Re: [INTERFACES] Re: [HACKERS] CORBA STATUS