Using POSIX thread library two threads are created by this program. Main program creates a file, let say, ‘alphanumeric data.txt’. The thread one writes some alpha numeric value along with system time in this file. Second thread reads this value from file and displays the following information on screen:

Alpha Numeric Value Time when Value was written to the File by first thread Time when Value was Read by the second Thread

What is your question?

Also, why would you use a text file to do this? It seems more natural to use an IPC mechanism more suited to such an operation - pipes, for example.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.