From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 25 Mar 2005 12:33:43 +0200 From: Sergey Reva Message-ID: <676328296.20050325123343@mail.ru> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] How it work? In-Reply-To: <4439b95e268ad4987f174271ac554f28@smtp.songnetworks.no> References: <3813520625.20050324104618@mail.ru> <4439b95e268ad4987f174271ac554f28@smtp.songnetworks.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 2b592d20-ead0-11e9-9d60-3106f5b1d025 Hello Fans! Still need help with Rendez... I can use lock, qlock and rendezvous without any problem but Rendez don't work... if rsleep executed earlier than rwakeup, abort() cause exception, stk() show: rsleep ... /sys/src/libc/9sys/qlock.c:286 This line contain me = getqlp() in getqlp i find abort()... in other way when rwakeup executed first, abort() ... stk() show: rwakeup ... /sys/src/libc/9sys/qlock.c:329 which point me to another abort() Maybe it wrong initialization? But I also try other way... or I wrong use rendez? #include #include QLock q={0}; Rendez r={.l=&q}; void testthread(void) { switch(rfork(RFPROC|RFMEM)) { case -1: print("can't fork"); exits(0); case 0: break; default: return; } for(;;) { print("Sleep\n"); rsleep(&r); print("Wake up!\n"); } exits(0); } void main(int,char**) { int x; testthread(); for (x=0;x<10;) { if (rwakeup(&r)) x++; } exits(0); } Thanks for help! -- http://rs-rlab.narod.ru mailto:rs_rlab@mail.ru