callback failure from threads?



I get a string of warnings that seem to (but may not be) lead up to a failure.

The failure is with a server using orbit2 on RH9, the client is a written in Java 1.4.2.

On connect I get:
** (process:5759): WARNING **: Ignoring incoming code_sets component

but everything seems fine.

Then I do a series of calls from the client. Each call sets up a function pointer on the server, and wakes a thread to perform the function, then returns. On the server side, once the woken thread finishes it's task, it calls a callback function on the client, then goes to sleep.

The first time I call the function on the server, everything works as expected, except I get a warning from the server when it performs the callback:
(process:5759): GLib-WARNING **: g_main_context_prepare(): main loop already active in another thread


The second time I call the function on the server, the server seems to stall or freeze, until I hit the return key, which seems to stimulate it into working. It seems to do the right thing, though it gives me the same warning:

(process:5759): GLib-WARNING **: g_main_context_prepare(): main loop already active in another thread

The third time I call the function on the server, it usually fails, giving me the error:

GLib-ERROR **: file gmain.c: line 1621 (g_main_dispatch): assertion failed: (source)
aborting...
Aborted


However, sometimes it just stalls, until I hit the return key again (this hitting the return key business is happening in the terminal that starts the server).

And sometimes it works semi-consistently after I hit the return key a bunch of times, and I have to go for a long time before the error occurs again.

I'd seen a post relating to a similar error a couple of years ago, but there was no attempt to resolve that. Does anybody have any ideas as to what might be going on?

The general outline of the server is:
start three threads, each thread talks to a mechanism. each thread sleeps on a mutex/conditional.
initialize the corba connection and process calls from the client.


calls from the client set up a function pointer and then wake the apropriate thread to perform that function, which typically involves controlling a motor/moving a mechanism. Once the mechanism has been correctly adjusted, the thread calls a callback function, then goes back to sleep.

Thanks in advance,

-Charles Lockhart

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]