From owner-freebsd-threads@FreeBSD.ORG Wed Jun 18 06:46:25 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74BFE37B401 for ; Wed, 18 Jun 2003 06:46:25 -0700 (PDT) Received: from web12401.mail.yahoo.com (web12401.mail.yahoo.com [216.136.173.128]) by mx1.FreeBSD.org (Postfix) with SMTP id C824343F3F for ; Wed, 18 Jun 2003 06:46:24 -0700 (PDT) (envelope-from ks4usa@yahoo.com) Message-ID: <20030618134624.85995.qmail@web12401.mail.yahoo.com> Received: from [12.29.176.205] by web12401.mail.yahoo.com via HTTP; Wed, 18 Jun 2003 06:46:24 PDT Date: Wed, 18 Jun 2003 06:46:24 -0700 (PDT) From: Sergey Kosyakov To: Daniel Eischen In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-threads@freebsd.org Subject: Re: The first kse_create call X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2003 13:46:25 -0000 --- Daniel Eischen wrote: > > You have to have both a thread mailbox pointer set in the > KSE mailbox and you have to expire the quantum. The quantum > is system plus user time. It is not real time (e.g., a nanosleep() > does not expire quantum while it sleeps). I'm trying to do this: mbx.km_version=KSE_VER_0; mbx.km_func=uc_1; mbx.km_stack.ss_sp=stack_1; mbx.km_stack.ss_size=SIGSTKSZ; mbx.km_stack.ss_flags=SS_ONSTACK; ret=getcontext(&(thr_mbx.tm_context)); printf("getcontext %d\n",ret); thr_mbx.tm_context.uc_link=NULL; thr_mbx.tm_context.uc_stack.ss_sp=thr_stack_1; thr_mbx.tm_context.uc_stack.ss_size=SIGSTKSZ; thr_mbx.tm_context.uc_stack.ss_flags=SS_ONSTACK; makecontext(&(thr_mbx.tm_context),func,0); thr_mbx.tm_uticks=10; thr_mbx.tm_sticks=0; mbx.km_curthread=&thr_mbx; ret=kse_create(&mbx,0); do { ++i; }while(1); And never got upcall. (But if I put printf in the loop I got the upcall). Thanks, Sergey. __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com