@andrew_the_coder, based on what little of the instructions you have presented, and in light of the fact that this exercise is apparently intended for inexperienced programmers, my interpretation is that you are intended to write one program that implements one reader, and another, separate program that implements one writer. Two (at least) source files, two
main()
functions, and synchronization objects and functions suited to that. Very approximately, your
reader()
and
writer()
might be converted to the
main
s, but really, not much of what you've presented serves. —
John Bollinger 19 secs ago