Go to Post As goes with all of my advice on CD, try it yourself and make up your own mind. I'm just suggesting things based on experience. See what works for your team. Follow my suggestions to the letter, mix and match them, or even throw them completely out the window. It's all about you and your team. - DampRobot [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-27-2009, 02:35 AM
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
setNewDataSem

I assume the function setNewDataSem allows me to pass a handle to a semaphore that will get processed each time a data packet arrives.

I'd like to use this mechanism instead of polling to see if a new message has arrived. Is this semaphore given (semGive) or flushed (semFlush) each time?

It does not seem to work no matter how I use it.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 02-01-2009, 03:49 AM
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: setNewDataSem

This actually does work. You can block any task on a semapahore you register this way. There is no need to give the semaphore back each time, it seems the semaphore gets flushed, not given, each time a new message comes in. So this is a great way to not have to poll to see if a new message has arrived.
Reply With Quote
Reply


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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
setNewDataSem wireties Programming 0 01-26-2009 03:30 AM


All times are GMT -5. The time now is 09:13 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi