[Vortex] Vortex_mutex issue under Linux?

Francis Brosnan Blazquez francis at aspl.es
Mon Jun 1 16:23:07 CEST 2009


> Hi everyone,

Hi Daniele,

> this is my problem: it seems the vortex_mutex lock/unlock mechanism works well under Windows,
> but not under Linux. 
> More deeply, this is my situation:
> 
> - a listener that dynamically loads/modifies/deletes some data into datastructs; 
>   it implements a frame_received callback making an internal call to a function that reads from 
>   the datastructs, sending the results to the initializer/client.
>   Our dev. group uses vortex_mutex_lock/unlock method to protect the access to that datastruct,
>   so every time a callback to frame_received() starts while the main process is 
>   loading/modifying/deleting data, the mutex should stop the new thread right before it begins to read
>   the structs.
>   Actually, under Linux, it seems the mutex lock inhibits only vortex functions to work (ex: "send_ans") and not the
>   whole piece of code. The same thing does not happen under Windows.  

Currently, vortex mutex API is a wrapper of the native implementation
provided by pthread (under linux/unix) and CreateMutex (under windows).

Having in mind this, there is no special implementation done for those
platforms that could lock *only* Vortex API while the rest not. What I
can confirm is that the thread planner work in a really different manner
under windows and linux, causing code path never seen before to be
activated when you switch (windows <-> linux).

Looks like a race condition not handled because code path not activated
under windows, which is now showed under Linux or some similar bug.

I would recommend to run your listener under the supervision of valgrind
to spot what's going on:

libtool --mode=execute valgrind --db-attach=yes ./your-listener

> - The following are the libraries we are using:
>   
>   WIN Server 2003:
>      vortex-1.0.16 (vortex installer) -> Visual Studio 2005
>   LINUX debian 2.6.26-2-686:
>      vortex-1.0.17.b3739.g3739 (tar.gz) -> gcc 4.3.2-1.1

I would recommend using 1.1 release though this is not the problem...

> I wonder if there's any explicit option to tell gcc to use vortex mutex in the right way:
> now i'm using the following:
> 
>   gcc 'xml2-config --cflags --libs' 'pkg-config --cflags --libs vortex' -lrt 

There is no such option. The intention is to make it developer
friendly ;-) You compile command looks fine. Cheers!

> Thanks in advance for your replies,
> Daniele Ricci
> 
-- 
Francis Brosnan Blazquez <francis at aspl.es>
ASPL



More information about the Vortex mailing list