[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming.threads

posix threads and signal handlers on HP-UX

rajesh.rajguru

8/7/2004 5:16:00 AM

We have a library which is used by many applications.This library has
two cache files(always one will be active)
Now we want to implement the threads in our library such a that every
application (process) using this library ,will create its own thread
and will keep running in its thread context. In this thread context we
will try to map the active cache file
We are thinking for following type of pseudo-code

void *refresh(void *arg)
{
//static mutex declaration
// pthread_try_lock()
// if locking is successful , wait for some time and map the active
cache file
//else exit thread
}

main()
{
//create thread (refresh will be passed as parameter)

}

As many processes will try to create the their threads (as they access
the same library), do you think of any problems in such types of
implementation ?
Will there be any problems if main process gets signal ?

Thanks & Regards,
Rajesh