Results 1 to 6 of 6

Thread: QNX port

  1. #1
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134

    QNX port

    I am trying to port Ice 3.1.1 to QNX real time OS. It now has gcc 3.3.5 so it wasn't too hard. Everything compiles now but some tests fail.

    The biggest problem is that in QNX, pthread_cond_wait() apparently cannot be used with recursive mutexes. "Recursive mutexes are non-POSIX services - they don't work with condvars."
    http://www.bitctrl.de/qnx/qnx6_sysar...sarch_2a.shtml

    So IceUtil::Monitor<IceUtil::Mutex> works fine but using IceUtil::Monitor<IceUtil::RecMutex> fails (an exception is thrown from line 208 of Cond.h). I wouldn't care about it in my own code, but ObjectAdapterI uses this pattern which makes it somewhat important.

    I know this platform is not supported but if somebody could point me in the right direction it'd be great.

    (I saw a possibly related post by Benoit from a long time ago but it talks about signalling a condvar without locking the mutex which could also be an issue. http://zeroc.com/vbulletin/showthread.php?t=69)

    thanks, alex
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    I would suggest to build your own recursive mutex in that case, replacing the IceUtil::RecMutex one. Use an ordinary mutex for the implementation and keep track of the identity of the locker. If the mutex is already locked by the locker, return from the lock() call after incrementing a lock count; in unlock(), decrement the lock count, and when it reaches zero, unlock the non-recursive mutex. If the lock() caller doesn't hold the mutex, and the mutex is locked, put the caller to sleep and wake him up when the mutex becomes available.

    Cheers,

    Michi.

  3. #3
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134
    Thanks Michi, I think i can do it.

    by the "identity of the locker" you mean the ID of the calling thread, is this right?

    alex
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  4. #4
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,140
    Hi Alex,

    Yes, using the ID of the calling thread will work! You can either use the pthread_t directly (but make sure to use pthread_equal to compare two pthread_t) or better, you could use the IceUtil::ThreadControl class to identify the thread, see the Ice manual for more information on this class.

    Cheers,
    Benoit.

  5. #5
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134
    Ok, got it to work. cool!

    i'm using pthread_self(), copied most of it from Benoit's MacOS X patch from 2003. all Ice and IceUtil tests check out. Still having problems with run-time linking to dependencies (SSL, DB), but i can probably fix it eventually.

    I was going to post a patch but want to ask ZeroC guys first if the next release is in the pipeline. can you tell me if it's days, weeks, months? if it's "days", i would wait, don't want to do this job twice in one week.

    cheers, alex
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  6. #6
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,858
    It's definitely not days. Next year!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to know which port the adapter is using?
    By nyingchi in forum Help Center
    Replies: 9
    Last Post: 02-08-2010, 03:57 PM
  2. C Port
    By slide_o_mix in forum Help Center
    Replies: 1
    Last Post: 01-27-2008, 09:12 PM
  3. QNX 6.3-SP3 for Ice-3.2.0
    By n2503v in forum Patches
    Replies: 0
    Last Post: 05-11-2007, 10:10 AM
  4. QNX 6.3-SP3 for Ice-3.1.1
    By n2503v in forum Patches
    Replies: 3
    Last Post: 01-24-2007, 08:06 AM
  5. ICE on QNX
    By kingkisin in forum Help Center
    Replies: 2
    Last Post: 12-03-2004, 07:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •