Menu

Multi Thread, Multi Process

2012-09-19
2012-09-21
  • André Rocha

    André Rocha - 2012-09-19

    Hello! I am using this lib excel beauty that works, but I want to use in various processes and looking at the code it seems that it creates a temporary file: C:\Users\osx\AppData\Local\Temp\xl\worksheets\sheet1.xml but what if I use various processes, they will not compete? sera that would separate these files in different folders by process ID?

    Português:
    Olá!! Eu estou usando essa lib de excel que funciona beleza, mas eu quero usar em varios processos e olhando o codigo dela parece que ele cria um arquivo temporario: C:\Users\osx\AppData\Local\Temp\xl\worksheets\sheet1.xml mas e se eu usar varios processos, eles não vão concorrer? sera que teria como separar esses arquivos em pastas diferentes pelo ID do processo?

     
  • Pavel Akimov

    Pavel Akimov - 2012-09-20

    Hello, Andre! Thank you for your reference. It works exactly how you guessed. I'll fix this problem (and some other) during next 1-2 days.

    Besides, in current versions it is not safe to use (fill up) datasheets of the same book from different threads because of defencelessness of the shared strings functionality against multiple access. I'll fix it either in next versions.

     
  • André Rocha

    André Rocha - 2012-09-21

    Não sei se é a melhor opção mas eu coloquei isso aqui:

    std::stringstream ss; ss << gszTempPath << "/" << getpid();
    gszTempPath = new char[ss.str().size()];
    strcpy( gszTempPath, ss.str().c_str() );

    file: Workbook.cpp

     

Log in to post a comment.