|
支持动态库rtp中staskSpawn出现的问题,求解决
[复制链接]
我用app.vxe起serverRtp.vxe时,如果serverRtp编译成支持动态库(-Xdynamic)的话,serverRtp.vxe在跑一会后就是异常。(cnt大约4万多次,而且跟app.vxe中HEAP_MAX_SIZE大小有关系)。请问有哪位遇到过这种情况吗?是怎么解决的
第一个RTP的代码(app.vxe) void main(void) {
printf("app.vxe Created on %s, %s\n", __DATE__, __TIME__); /*标记RTP编译时间,及RTP启动时间*/
taskDelay(1);
const char * argv[] = {"/tffs0/serverRtp.vxe", NULL};
const char * envp[] = {"HEAP_INITIAL_SIZE=0x100000", "HEAP_MAX_SIZE=0x200000", NULL};
rtpSpawn (argv[0], argv, envp, 200, 0x500000, 0, 0);
}
========================================================= 第二个RTP的代码(serverRtp.vxe),连接选项TOOL-flag将支持动态库选中了(-Xdynamic) int taskTcpConnection() {
return OK; }
int main(int argc, char* argv[]) {
int taskIdTmp=-1;
int cnt=0;
int i;
printf("serverRtp.vxe Created on %s, %s\n", __DATE__, __TIME__); /*标记RTP编译时间,及RTP启动时间*/
if(getenv("HEAP_INITIAL_SIZE") != NULL)
printf("HEAP_INITIAL_SIZE=%s\n",getenv("HEAP_INITIAL_SIZE"));
if(getenv("HEAP_MAX_SIZE") != NULL)
printf("HEAP_MAX_SIZE=%s\n",getenv("HEAP_MAX_SIZE"));
if(getenv("HEAP_INCR_SIZE") != NULL)
printf("HEAP_INCR_SIZE=%s\n",getenv("HEAP_INCR_SIZE"));
while(1)
{
if(taskIdVerify(taskIdTmp) == ERROR)
{
if((taskIdTmp = taskSpawn("abcdef",
160,
0,
0x1000,
taskTcpConnection,
0,0,0,0,0,0,0,0,0,0))==ERROR)
{
printf("%s() taskSpawn taskTcpConnection fail err=0x%x\n",__FUNCTION__,errnoGet());
taskDelay(3000);
continue;
}
cnt++;
if((cnt%1000)==0)
printf("%s() taskSpawn taskTcpConnection OK cnt=%d\n",__FUNCTION__,cnt);
}
} }
//=============================================================
|
|