[Vortex] Vortex listeners and threads
Francis Brosnan Blazquez
francis at aspl.es
Mon Jun 12 15:02:49 CEST 2006
El dom, 11-06-2006 a las 16:36 -0400, Philip Kovacs escribió:
> Hi.
>
Hi Phil!
> Am I correct that there is no way to shutdown a vortex listener, other than
> to execute the vortex_exit()?
Not completely.
Another way to stop a server is to call to vortex_listener_unlock, which
will produce the caller to vortex_listener_wait to be unblocked, then
perform all resource deallocation (of your application) and then call to
vortex_exit.
However, in serious SO, you don't really need to call to vortex_exit,
mainly because your kernel will get all memory allocated by your
application, even if you didn't deallocate it. vortex_exit function only
deallocates all memory used by Vortex Library.
> In the example server code, the
> vortex_exit()
> function, although indicated, is never really executed, correct?
>
> // use this thread, since no on_ready() indicated.
> vortex_listener_new <http://www.aspl.es/fact/files/af-arch/vortex/html/group__vortex__listener_gcde5adbdfd99172186ed01f01462e351.html#gcde5adbdfd99172186ed01f01462e351> ("0.0.0.0", "3000", NULL, NULL);
>
> // this is the last executed program statement, right?
> vortex_listener_wait <http://www.aspl.es/fact/files/af-arch/vortex/html/group__vortex__listener_ga5c4c16502386b2e2f3370d34fb03d6d.html#ga5c4c16502386b2e2f3370d34fb03d6d> ();
>
> // never executed
> vortex_exit <http://www.aspl.es/fact/files/af-arch/vortex/html/group__vortex_gfcf3c4dbca2a82c369cc2268ec97363d.html#gfcf3c4dbca2a82c369cc2268ec97363d> ();
>
It is always executed. However, it could happen that a previous call to
vortex_exit have already done, in another thread, doing the vortex
shutdown process, so the next call to vortex_exit does nothing.
In the other hand, it could happen that the thread stopping the server
didn't call to vortex_exit, but to vortex_listener_unblock, making the
last sentece, the call to vortex_exit, to be called and responsible of
doing the vortex stop process.
>
> The documentation for the function vortex_listener_wait() is confusing:
>
> "Blocks a listener (or listeners) launched until vortex finish."
> // You're blocking the calling thread, not the listener, right?
You are right, I'll change it. Thanks for reporting.
>
> This function should be called before creating a server calling to
> vortex_listener_new
> <http://www.aspl.es/fact/files/af-arch/vortex/html/group__vortex__listener_gcde5adbdfd99172186ed01f01462e351.html#gcde5adbdfd99172186ed01f01462e351>
> to block current thread."
> // I don't understand what is meant by this statement.
>
The function is not properly documented. Where it says *before* should
say *after*.
Cheers!
> Phil
>
>
>
>
>
>
>
>
> _______________________________________________
> Vortex mailing list
> Vortex at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex
>
>
--
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.
More information about the Vortex
mailing list