Hi Karl,
Yes, the overrun has nothing to do with threading... I only ran into it
running the special MSVC Debug build, which has a special prologue to write
a marker, like oxcc, to ALL stack variable, and an epilogue that checks
for invasions...
of various types... very special case...
And since in this case it seemed just by 1 byte, although there could have
been others, which 'normally' will not cause a problem, so long as it is
not killing a variable still in use, then the results are totally
unpredictable...
Maybe will not have time tonight to pull and test your latest...
Ok, concerning 'creat()', I too think this system call would be 100%
thread safe,
why not? so I did what you suggested - found some simple code here -
https://www.technical-recipes.com/2016/using-posix-threads-in-microsoft-visual-studio/
... copied in your 'creat(buf, 0666)'... into the perform_work thread...
and BANG got
an exception...
I was overlooking your permission value... 0666... the exception is an
'invalid parameter'
dialog... when I replace that with '_S_IREAD | _S_IWRITE', 0x0180,
everything ran smooth...
5 threads create, 5 temp files created... no problems...
So this solves it in my mind... what about you?
Will get to a pull soonest...
Regards, Geoff.