Hello everyone
I have a question about InitializeCriticalSection.
Thank you for your support!
Hello everyone
I have a question about InitializeCriticalSection.
Thank you for your support!
In my opinion, the next approach should work:
When start program
• Create file
• InitializeCriticalSection
Write file
• EnterCriticalSection
• Write file
• If file > 2M then create new file
• LeaveCriticalSection
Create new file
• Close current file
• Create new file, make it current file
End program
• Close current file
• DeleteCriticalSection
or an alternative:
When start program
• InitializeCriticalSection
Write file
• EnterCriticalSection
• If file not created then create file
• Else If file > 2M then create new file
• Write file
• LeaveCriticalSection
Create new file
• Close current file
• Create new file, make it current file
End program
• If file created then close file
• DeleteCriticalSection
You must also finish the threads before executing 4.
4 people are following this question.