Search Results

Search found 2 results on 1 pages for 'stck'.

Page 1/1 | 1 

  • Problem with setjmp/longjmp

    - by user294732
    The code below is just not working. Can anybody point out why #define STACK_SIZE 1524 static void mt_allocate_stack(struct thread_struct *mythrd) { unsigned int sp = 0; void *stck; stck = (void *)malloc(STACK_SIZE); sp = (unsigned int)&((stck)); sp = sp + STACK_SIZE; while((sp % 8) != 0) sp--; #ifdef linux (mythrd->saved_state[0]).__jmpbuf[JB_BP] = (int)sp; (mythrd->saved_state[0]).__jmpbuf[JB_SP] = (int)sp-500; #endif } void mt_sched() { fprintf(stdout,"\n Inside the mt_sched"); fflush(stdout); if ( current_thread->state == NEW ) { if ( setjmp(current_thread->saved_state) == 0 ) { mt_allocate_stack(current_thread); fprintf(stdout,"\n Jumping to thread = %u",current_thread->thread_id); fflush(stdout); longjmp(current_thread->saved_state, 2); } else { new_fns(); } } } All I am trying to do is to run the new_fns() on a new stack. But is is showing segmentation fault at new_fns(). Can anybody point me out what's wrong.

    Read the article

  • Tomcat's connection pool opens only 20 connections to mysql

    - by stck
    I have a java application with following line in context.xml <Resource driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30" initialSize="10" maxWait="7000" name="jdbc/app" password="pass" type="javax.sql.DataSource" url="jdbc:mysql://dbhost:3306/dbname?autoReconnect=true" username="user" validationQuery="SELECT 1" removeAbandoned="true" removeAbandonedTimeout="30" logAbandoned="true" /> In mysql 'show variables' tells me that max_connections is 151. Still, use information_schema; select count(*) from processlist where User = 'user'; never shows me more than 20 connections. On tomcat's catalina.out -log I get Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool exhausted at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) What should I check for to find the problem?

    Read the article

1