From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2279 invoked by alias); 12 Oct 2007 12:12:39 -0000 Received: (qmail 2271 invoked by uid 22791); 12 Oct 2007 12:12:38 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0910.google.com (HELO rv-out-0910.google.com) (209.85.198.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Oct 2007 12:12:36 +0000 Received: by rv-out-0910.google.com with SMTP id l15so703931rvb for ; Fri, 12 Oct 2007 05:12:34 -0700 (PDT) Received: by 10.141.145.11 with SMTP id x11mr1439444rvn.1192191154554; Fri, 12 Oct 2007 05:12:34 -0700 (PDT) Received: by 10.140.162.10 with HTTP; Fri, 12 Oct 2007 05:12:34 -0700 (PDT) Message-ID: <61e59ce30710120512i40fd0912t1df90a33c59e9f26@mail.gmail.com> Date: Mon, 12 Nov 2007 19:58:00 -0000 From: "mlnglstaccram alksjd" To: pthreads-win32@sourceware.org Subject: Trying to develop a pool executor from pthreads... in C++ MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2007/txt/msg00046.txt.bz2 For the sake of learning i am trying to develp a pool executor... but it doesnt work.. can u ppl tell me where i am goin wrong? I am getting an assertion failure in windows in the line below with comments, in file PoolExecutor.h.. /* main.cpp */ #include #include #include #include "PoolExecutor.h" using namespace std; class Runner{ public: Runner(){} ~Runner(){} void run(){ for(int i=0;i<100;++i) cout<<"i="< #include #include class PoolExecutor; void *func(void *temp); class Runnable{ public: virtual void run()=0; }; class Thread{ pthread_t threadId; Runnable *runnable; public: Thread(){ runnable=NULL; } void start(PoolExecutor *pthRun){ int started = pthread_create (&threadId, NULL, func, pthRun); std::cout<< started< taskQueue; pthread_mutex_t taskQueueMutex; public: PoolExecutor(int numberOfThreads){ N=numberOfThreads; if(numberOfThreads<=0 && numberOfThreads>512) N=5; cancelled= false; pthread_mutex_init(&taskQueueMutex,NULL); threads = new Thread[N]; for(int i=0;irun(); delete runnable; if(cancelled){ return NULL; } } return NULL; } }; void *func(void *temp){ PoolExecutor *poolExecutor = (PoolExecutor *)temp; return poolExecutor->runMethod(NULL); } Thanks