I'm not sure exactly where to lock and unlock functions when I am trying to, for example,
save characters to a file every five secs. Can anyone show me an example of how to use
threads to save a file every so many seconds.
Thanks,
Roddman
I'm not sure exactly where to lock and unlock functions when I am trying to, for example,
save characters to a file every five secs. Can anyone show me an example of how to use
threads to save a file every so many seconds.
Thanks,
Roddman
What thread library?
Um... Solaris threads.
There's example code in the solaris threads documentation here:
http://docsun.cites.uiuc.edu/sun_doc...init.3thr.html
You will need to mutex all access to the file and data. Then when you're ready to save, acquire exclusive access to the file and data, then save.
Consider switching to pthreads if you can. There are a lot more resources for learning pthreads.
gg