fclose() causing access violation in threadFunc

A

Anoop Nair

Hello,

I saw several posts dealing with similar issues but was unable to
find a resolution.

I have a multi-threaded application where different threads
operate on different files. I do not see a chance for a conflict where
a file pointer from one thread would be available to another. However,
I'm getting an Access Violation on the fclose() in some threads. I
would appreciate any insight into the same. Since this is a C++ group,
I also tried ofstream related methods, but they too cause the same
error.

Thanks in advance,

Anoop
 
V

Victor Bazarov

Anoop said:
I saw several posts dealing with similar issues but was unable to
find a resolution.

I have a multi-threaded application where different threads
operate on different files. I do not see a chance for a conflict where
a file pointer from one thread would be available to another. However,
I'm getting an Access Violation on the fclose() in some threads. I
would appreciate any insight into the same. Since this is a C++ group,
I also tried ofstream related methods, but they too cause the same
error.

Multi-threading is not part of C++ and that makes your problem basically
not possible to solve using C++ language means. I am guessing here, but
you probably will be able to find more information in a newsgroup specific
to threads (comp.programming.threads) or to your OS (comp.os.???).

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top