About Store Forum Documentation Contact



Post Reply 
Thread safety of File object
Author Message
rndbit Offline
Member

Post: #1
Thread safety of File object
I was wondering if its safe to use File objects from different threads. I actually have in mind different file objects, not the same one. My logic dictates to me that it should be safe, however i have cryptic crash that happens somewhere within the engine. I think it started appearing when i added some code using 'File' in alternative thread, tho i am not sure since it was long ago and i work with this code not that often. Any clues?
Code:
    ntdll.dll!_NtRaiseException@12()  + 0x12 bytes    
    ntdll.dll!_NtRaiseException@12()  + 0x12 bytes    
    KernelBase.dll!76fabc3a()     
    [Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]    
>    msvcr100.dll!_tsopen_nolock(int * punlock_flag=0x005ea440, int * pfh=0x00000000, const wchar_t * path=0x0034ed48, int oflag=1651486210, int shflag=5, int pmode=1651486350, int bSecure=0)  Line 486    C
    001a0000()    
    kernel32.dll!772914dd()     
    msvcr100.dll!free(void * pBlock=0x005ea440)  Line 51    C
    DemolitionMan.exe!EE::Free()  + 0x11 bytes    C++
    DemolitionMan.exe!EE::File::readStdTry()  + 0x132 bytes    C++
    DemolitionMan.exe!EE::File::readTry()  + 0x2d bytes    C++
    DemolitionMan.exe!EE::Image::load()  + 0x45 bytes    C++
    DemolitionMan.exe!EE::ClassFunc<EE::Image>::Load()  + 0xe bytes    C++
    DemolitionMan.exe!EE::_Cache::_get()  + 0x266 bytes    C++
    DemolitionMan.exe!EE::_Cache::_require()  + 0x4c bytes    C++
    DemolitionMan.exe!EE::CacheElmPtr<EE::Image,EE::_Images>::require()  + 0x28 bytes    C++
    DemolitionMan.exe!EE::Material::loadData()  + 0x100 bytes    C++
    DemolitionMan.exe!EE::Material::load()  + 0x91 bytes    C++
    DemolitionMan.exe!EE::ClassFunc<EE::Material>::Load()  + 0xe bytes    C++
    DemolitionMan.exe!EE::_Cache::_get()  + 0x2b3 bytes    C++
    DemolitionMan.exe!EE::_Cache::_require()  + 0x4c bytes    C++
    DemolitionMan.exe!EE::Game::Area::Data::load()  + 0x11f bytes    C++
    DemolitionMan.exe!EE::Game::WorldManager::areaLoad()  + 0xfb bytes    C++
    DemolitionMan.exe!EE::Game::WorldManager::areaUpdateState()  + 0x88 bytes    C++
    DemolitionMan.exe!EE::_Cell::funcCreate()  + 0x3a2 bytes    C++
    DemolitionMan.exe!EE::_Cell::funcCreate()  + 0x230 bytes    C++
    DemolitionMan.exe!EE::_Cell::funcCreate()  + 0x230 bytes    C++
    DemolitionMan.exe!EE::_Cell::funcCreate()  + 0x230 bytes    C++
    DemolitionMan.exe!EE::_Grid::funcCreate()  + 0x78 bytes    C++
    DemolitionMan.exe!EE::Game::WorldManager::areaUpdateState()  + 0x2f7 bytes    C++
    DemolitionMan.exe!EE::Game::WorldManager::update()  + 0x38c bytes    C++
    DemolitionMan.exe!EE::Game::WorldManager::update(const EE::Vec & pos={...})  Line 174 + 0x3b bytes    C++
    DemolitionMan.exe!StateMenu::update()  Line 43    C++
    DemolitionMan.exe!StateBase<StateMenu>::_update()  Line 29 + 0x20 bytes    C++
    DemolitionMan.exe!EE::UpdateState()  + 0xa5 bytes    C++
    DemolitionMan.exe!EE::Application::loop()  + 0xcf bytes    C++
    DemolitionMan.exe!_WinMain@16()  + 0x22 bytes    C++
    DemolitionMan.exe!__tmainCRTStartup()  Line 547 + 0x1c bytes    C
12-07-2011 03:08 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Thread safety of File object
yes, different File objects can be safely used across multiple threads.
My guess is you have some bug in some place which causes some memory corruption or something.
12-08-2011 12:39 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Thread safety of File object
I'll check if the engine there aren't any issues, please hold on
12-08-2011 12:43 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Thread safety of File object
I've tested ERPG2 with latest engine and it works fine.
12-08-2011 12:47 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #5
RE: Thread safety of File object
yep, it must be me. thanks for verifying.
12-08-2011 01:41 PM
Find all posts by this user Quote this message in a reply
Post Reply