[jacorb-developer] Execution order in server
Phil Mesnier
mesnier_p at ociweb.com
Tue May 26 18:40:38 CEST 2015
Hi Kujtim,
JacORB is heavily threaded. First, the typical connection management behavior is to spawn a reader thread for each client connection. These threads will naturally order the requests from their own connection, but two requests on different connections can arrive concurrently so "first" depends on how the threads are scheduled. Anyway, the newly received requests are queued for processing by a servant manager which delegates to a separate thread pool. At this point it is possible for request 2 to be finished processing before request 1 if request 1 involved blocking behavior or that thread was simply swapped out for a period.
If your servant code is not reentrant you need to synchronize access. There is a POA threading policy that can be used to assert single-threaded behavior on a particular POA and its servants, but I've not tested it on JacORB so YMMV.
Best regards,
Phil
> On May 14, 2015, at 9:54 AM, Kujtim Hyseni <kujtimhyseni at hotmail.com> wrote:
>
> Hi,
>
> if there are several clients requesting operation execution from server, what is the order of execution, in order the request arrives in server (FIFO) or ? And, what if the second request finishes before the first, is this situation possible to happen, I think not if the first arrived is executed (served) first. In other case, should I use synchronized keyword for operations to avoid parallelism of execution (since this is required by my application)?
>
> Kujtim
>
> _______________________________________________
> jacorb-developer maillist - jacorb-developer at lists.spline.inf.fu-berlin.de
> https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
--
Phil Mesnier
Principal Software Engineer and Partner, http://www.ociweb.com
Object Computing, Inc. +01.314.579.0066 x225
More information about the jacorb-developer
mailing list