#include <stdio.h>
#include <pthread.h>
#include "libxml.h"

/* This is our thread function.  It is like main(), but for a thread */
void *threadFunc(void *arg)
{
    char *str;

    //int i = 0;
    usleep(rand()%100);

    str=(char*)arg;
    xmlInitParser();

    usleep(rand()%100);
    xmlCleanupParser();
    if(rand()%4)
     xmlCleanupParser();

    return NULL;
}

int main(void)
{
    pthread_t pth[200];  
    int i = 0;

    /* Create worker thread */
    for(i=0;i<200;i++)
    pthread_create(&pth[i],NULL,threadFunc,"processing...");
    

    return 0;
}
