fclose() causing access violation in threadFunc

Discussion in 'C++' started by Anoop Nair, Aug 5, 2004.

  1. Anoop Nair

    Anoop Nair Guest

    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
     
    Anoop Nair, Aug 5, 2004
    #1
    1. Advertising

  2. Anoop Nair wrote:
    > 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
     
    Victor Bazarov, Aug 5, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB
    Replies:
    3
    Views:
    5,257
    Ron Natalie
    Jan 15, 2005
  2. viza

    fclose(stdin);

    viza, Jul 19, 2003, in forum: C Programming
    Replies:
    0
    Views:
    453
  3. Marcus Jacobs

    Problem with FCLOSE

    Marcus Jacobs, Aug 5, 2003, in forum: C Programming
    Replies:
    11
    Views:
    626
    Chris Torek
    Aug 7, 2003
  4. Trying_Harder

    fgets,fopen, fclose

    Trying_Harder, Aug 26, 2003, in forum: C Programming
    Replies:
    5
    Views:
    699
    John Bode
    Sep 3, 2003
  5. prama

    Re: Question about fopen, fput, fclose?

    prama, Aug 26, 2003, in forum: C Programming
    Replies:
    5
    Views:
    1,787
    Jack Klein
    Aug 28, 2003
Loading...

Share This Page