vimalalex
asked on
C++ in Mac OSX
Hi experts,
I am using Xcode developement sute for C++ programming in Mac OS. I am basically a C++ programmer in windows OS. Is there any equivalent functions for CreateEvent(), OpenEvent(), SetEvent(), ResetEvent() in Mac OS C++.I am a beginner for Mac OS developement.
Regards,
Vimal.
I am using Xcode developement sute for C++ programming in Mac OS. I am basically a C++ programmer in windows OS. Is there any equivalent functions for CreateEvent(), OpenEvent(), SetEvent(), ResetEvent() in Mac OS C++.I am a beginner for Mac OS developement.
Regards,
Vimal.
ASKER
Hi fridom,
Thank for your reply. Actually I need a event handle object and need a API for waiting that handle for an event firing. For example in VC++ we have an api CreateEvent() which will return a HANDLE type and we have a api WaitForSingleObject(handle ToObject) which will wait untill it get a event firing by an api SetEvent(handleToObject). These apis we can use in c and c++.
Regards,
Vimal
Thank for your reply. Actually I need a event handle object and need a API for waiting that handle for an event firing. For example in VC++ we have an api CreateEvent() which will return a HANDLE type and we have a api WaitForSingleObject(handle
Regards,
Vimal
Well have you checked the link? You surely will be able to mix C++ and Objective-C on Mac OS X.
ASKER
Hi fridom,
I have gone through the above link, but I didnt find any stuff exactly I need. The link you given shows some methods which work like a button click events ie when the event fires it will call a
callback function. but my requirement is line Sleep() functioin the thread should wait in a waitfunction untill
an event firing. For a better example in C by calling getch() function the thread will wait untill a key like like this I want to wait for a event in thread function. For this in VC++ we have a Windows API WaitForSingleObject() in this we can pass a event handle and WaitForSingleObject() function will wait untill a event firing or we can set a time out for the WaitForSingleObject() function.
Regards,
Vimal
I have gone through the above link, but I didnt find any stuff exactly I need. The link you given shows some methods which work like a button click events ie when the event fires it will call a
callback function. but my requirement is line Sleep() functioin the thread should wait in a waitfunction untill
an event firing. For a better example in C by calling getch() function the thread will wait untill a key like like this I want to wait for a event in thread function. For this in VC++ we have a Windows API WaitForSingleObject() in this we can pass a event handle and WaitForSingleObject() function will wait untill a event firing or we can set a time out for the WaitForSingleObject() function.
Regards,
Vimal
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi fridom,
Thank you very much pthread_cond_t is working fine. I have done some samples which were working fine with the threads in a process.How I can use pthread_cond_t, pthread_cond_init(), pthread_cond_wait() , etc.. to work with in diffrent process ie is there any way to fire signal using pthread_cond_signal() from one application to another, Interprocess communication.
Thanks & Regards,
Vimal.
Thank you very much pthread_cond_t is working fine. I have done some samples which were working fine with the threads in a process.How I can use pthread_cond_t, pthread_cond_init(), pthread_cond_wait() , etc.. to work with in diffrent process ie is there any way to fire signal using pthread_cond_signal() from one application to another, Interprocess communication.
Thanks & Regards,
Vimal.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/EventObjectsTypes/EventObjectsTypes.html
Just to mention it. OpenEvent etc has nothing to do with C++ programming that are C functions.