Owais,
I would call the User Interface library function PostDeferredCall() from your "Producer" thread. Here is the prototype:
int PostDeferredCall (DeferredCallbackPtr
Deferred_Function, void *Callback_Data);
To pass information in the other direction, use PostDeferredCallToThread().
Note: Callback_Data is either NULL or a pointer to data that you define.
There are other ways to provide communication between the threads of your app, including Thread Safe Queues.
Your main thread will respond provided you call RunUserInterface() or ProcessSystemEvents().
Here is a useful reference on multithreading.
Regards,
Colin.