Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 12-17-2006
n2503v n2503v is offline
Registered User
 
Name: Alex Makarenko
Organization: ACFR, University of Sydney
Project: Orca
 
Join Date: Jun 2005
Posts: 82
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
Australian Centre for Field Robotics
The University of Sydney
www.cas.edu.au
project: orca-robotics.sf.net
Reply With Quote
  #2 (permalink)  
Old 12-17-2006
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 931
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.
Reply With Quote
  #3 (permalink)  
Old 12-17-2006
n2503v n2503v is offline
Registered User
 
Name: Alex Makarenko
Organization: ACFR, University of Sydney
Project: Orca
 
Join Date: Jun 2005
Posts: 82
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
Australian Centre for Field Robotics
The University of Sydney
www.cas.edu.au
project: orca-robotics.sf.net
Reply With Quote
  #4 (permalink)  
Old 12-18-2006
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,564
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.
Reply With Quote
  #5 (permalink)  
Old 12-18-2006
n2503v n2503v is offline
Registered User
 
Name: Alex Makarenko
Organization: ACFR, University of Sydney
Project: Orca
 
Join Date: Jun 2005
Posts: 82
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
Australian Centre for Field Robotics
The University of Sydney
www.cas.edu.au
project: orca-robotics.sf.net
Reply With Quote
  #6 (permalink)  
Old 12-18-2006
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
It's definitely not days. Next year!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to know which port the adapter is using? nyingchi Help Center 7 07-07-2008 04:29 PM
how to bind 0.0.0.0:port ? ewiniar Help Center 3 06-22-2006 10:15 PM
why not and when does ICE port to Symbian OS? genelee Comments 4 12-08-2005 04:42 PM
Port 80 and Gaming sevensix Help Center 8 05-11-2005 10:14 AM
AIX Port ScottDiedrick Help Center 1 04-13-2004 05:37 PM


All times are GMT -4. The time now is 11:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.