From: <Or...@us...> - 2008-06-22 18:43:19
|
Revision: 276 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=276&view=rev Author: Oracle_ Date: 2008-06-22 11:43:23 -0700 (Sun, 22 Jun 2008) Log Message: ----------- Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp ACMServer/trunk/sharp tester/SourceTest/SourceTest.h ACMServer/trunk/sharp tester/tester/SAMPLE/Test/limits.txt Modified: ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp 2008-06-22 08:35:12 UTC (rev 275) +++ ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp 2008-06-22 18:43:23 UTC (rev 276) @@ -12,7 +12,6 @@ const wchar_t USER_NAME[]={L"TestingUser"}; //username for testing const wchar_t USER_PASSW[]={L"USER12345"}; //password of user for testing const int CONST_SLEEP=100; //constant used for waiting for files to be created/flushed on disk -const int MAX_THREAD=2; //maximum parallel threads namespace SourceTest { @@ -294,7 +293,7 @@ } FThreads.Clear(); - for (int i=0;i<min(MAX_THREAD,FTestCnt-1);i++) + for (int i=0;i<min(FLim.MaxThreads-1,FTestCnt-1);i++) AddThread(); for (int i=0;i<FThreads.Count;i++) ((Threading::Thread^)FThreads[i])->Join(INFINITE); @@ -671,7 +670,8 @@ } fopen_s(&f,buf=StrToArr(path),"rt"); fscanf_s(f,"CodeLimit: %d\nCompilationTimeLimit: %d\nMemoryLimit: %d\n",&FLim.CodeLimit,&FLim.CompilationTimeLimit,&FLim.MemoryLimit); - fscanf_s(f,"OutputLimit: %d\nRealTimeLimit: %d\nTimeLimit: %d",&FLim.OutputLimit,&FLim.RealTimeLimit,&FLim.TimeLimit); + fscanf_s(f,"OutputLimit: %d\nRealTimeLimit: %d\nTimeLimit: %d\n",&FLim.OutputLimit,&FLim.RealTimeLimit,&FLim.TimeLimit); + fscanf_s(f,"MaxThreads: %d",&FLim.MaxThreads); }__finally { fclose(f); Modified: ACMServer/trunk/sharp tester/SourceTest/SourceTest.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest/SourceTest.h 2008-06-22 08:35:12 UTC (rev 275) +++ ACMServer/trunk/sharp tester/SourceTest/SourceTest.h 2008-06-22 18:43:23 UTC (rev 276) @@ -27,6 +27,7 @@ int RealTimeLimit; //maximum real time int CompilationTimeLimit; //maximum time for compilation int CodeLimit; //maximum source size + int MaxThreads; //maximum paralle threads TLimits() { @@ -294,7 +295,7 @@ void init() { cs=new CRITICAL_SECTION; - InitializeCriticalSection(cs); + InitializeCriticalSectionAndSpinCount(cs,100); } void lock() @@ -652,6 +653,7 @@ { lock(); FTempPath=value; + System::IO::Directory::CreateDirectory(FTempPath); }__finally { unlock(); Modified: ACMServer/trunk/sharp tester/tester/SAMPLE/Test/limits.txt =================================================================== --- ACMServer/trunk/sharp tester/tester/SAMPLE/Test/limits.txt 2008-06-22 08:35:12 UTC (rev 275) +++ ACMServer/trunk/sharp tester/tester/SAMPLE/Test/limits.txt 2008-06-22 18:43:23 UTC (rev 276) @@ -4,3 +4,4 @@ OutputLimit: 1024 RealTimeLimit: 100000 TimeLimit: 500 +MaxThreads: 4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |