Re: [eclipse-clp-users] embedded ECLiPSe in C++, problems with post event

From: Joachim Schimpf <jschimpf_at_...311...>
Date: Fri, 22 Mar 2013 22:47:44 +0100
On 22/03/2013 18:47, Gesche Gierse wrote:
> Hello,
>
> I'm currently using ECLiPSe embedded in a C++ project and I'm facing
> some problem with sending events from C++ to ECLiPSe.
>
> The C++ project has various threads, some running continuous, others
> only for some time. The ECLiPSe context is initialized within one of the
> continuous threads.
> However the ECLiPSe program I want to run needs to call an predicate
> whenever the control-thread is running (this is one of the
> none-continuous threads). So I post an event to the ECLiPSe context
> every time the control-thread is running.
>
> Everything compiles just fine, and for like a minute it will run the way
> it should, but at some time I always get a "Bogus event queue
> notification in next_posted_event()"-error.
>
> So my question is, is this a threading problem? Does posting events not
> work well, when used in a thread that is non-continuous?

Yes, this is very likely a threading problem.  The current event posting
mechanism is not designed for thread communication.

Could you briefly explain a few more details about your architecture,
so we can suggest an alternative solution:
Does your ECLiPSe thread process jobs that it receives via these events?
If yes, are these jobs then queued, or interrupt each other?
Is the event simple, or are you passing any data (arguments, etc)
along with the event notification?  Or is it just an abort-event?


-- Joachim
Received on Fri Mar 22 2013 - 21:47:55 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 22 2024 - 18:13:20 CET