Visual Studio 2012 c++11 thread 多线程,该如何解决

Visual Studio 2012 c++11 thread 多线程
各位大神好,我的一个工程使用visual studio2012 编写的,其中使用了c++11的thread库多线程实现一个树结构并行查询,但是发现vs2012最多只能创建10个线程,多余10个线程时候就会抛出Resource Unavailable 异常,郁闷,Win和Linux专有的多线程库都不会这样,是我理解错了吗?是vs2012需要别的设置吗?

for(int i=0;i<vpb->threadNum;i++)
{
try
{
threadlist[i]=thread(threadpoolfunc,&tptask);
}
catch(std::system_error &e)
{
cerr<<__FILE__<<__LINE__<<" Exception:"<<e.what()<<" arise at "<<e.code()<<" when i:"<<i<<endl;
i--;
continue;
}
catch(std::bad_alloc &e)
{
//cerr<<__LINE__<<" Exception:"<<e.what()<<" arise at i:"<<i<<endl;
i--;
continue;
}
catch(exception &e)
{
//cerr<<__LINE__<<" Exception:"<<e.what()<<" arise at i:"<<i<<endl;
i--;
continue;
}
}



我的机器是Pentium(R) Dual-Core CPU E5800 @ 3.20GHz 3.20Ghz, 创建11个线程时会抛出异常。
当我在4核机器上跑时,同样是创建11个现场时会抛出异常,郁闷,莫名其妙
Visual Studio 2012 c++11 thread 多线程,该如何解决

------解决方案--------------------
崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处。

------解决方案--------------------
//循环向a函数每次发送200个字节长度(这个是固定的)的buffer,
//a函数中需要将循环传进来的buffer,组成240字节(也是固定的)的新buffer进行处理,
//在处理的时候每次从新buffer中取两个字节打印
#ifdef WIN32
    #pragma warning(disable:4996)
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
    #include <windows.h>
    #include <process.h>
    #include <io.h>
    #define  MYVOID             void
    #define  vsnprintf          _vsnprintf
#else
    #include <unistd.h>
    #include <sys/time.h>
    #include <pthread.h>
    #define  CRITICAL_SECTION   pthread_mutex_t
    #define  MYVOID             void *
#endif
//Log{
#define MAXLOGSIZE 20000000
#define MAXLINSIZE 16000
#include <time.h>
#include <sys/timeb.h>
#include <stdarg.h>
char logfilename1[]="MyLog1.log";
char logfilename2[]="MyLog2.log";
static char logstr[MAXLINSIZE+1];
char datestr[16];
char timestr[16];
char mss[4];
CRITICAL_SECTION cs_log;
FILE *flog;
#ifdef WIN32
void Lock(CRITICAL_SECTION *l) {
    EnterCriticalSection(l);
}
void Unlock(CRITICAL_SECTION *l) {
    LeaveCriticalSection(l);
}
void sleep_ms(int ms) {
    Sleep(ms);
}
#else
void Lock(CRITICAL_SECTION *l) {
    pthread_mutex_lock(l);
}
void Unlock(CRITICAL_SECTION *l) {
    pthread_mutex_unlock(l);
}
void sleep_ms(int ms) {
    usleep(ms*1000);
}
#endif
void LogV(const char *pszFmt,va_list argp) {
    struct tm *now;
    struct timeb tb;

    if (NULL==pszFmt
------解决方案--------------------
0==pszFmt[0]) return;
    vsnprintf(logstr,MAXLINSIZE,pszFmt,argp);
    ftime(&tb);
    now=localtime(&tb.time);
    sprintf(datestr,"%04d-%02d-%02d",now->tm_year+1900,now->tm_mon+1,now->tm_mday);
    sprintf(timestr,"%02d:%02d:%02d",now->tm_hour     ,now->tm_min  ,now->tm_sec );
    sprintf(mss,"%03d",tb.millitm);
    printf("%s %s.%s %s",datestr,timestr,mss,logstr);
    flog=fopen(logfilename1,"a");
    if (NULL!=flog) {
        fprintf(flog,"%s %s.%s %s",datestr,timestr,mss,logstr);
        if (ftell(flog)>MAXLOGSIZE) {
            fclose(flog);
            if (rename(logfilename1,logfilename2)) {
                remove(logfilename2);
                rename(logfilename1,logfilename2);
            }
        } else {
            fclose(flog);
        }