Date: Fri, 23 Oct 1998 16:30:01 -0700 (PDT) From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> To: freebsd-bugs@FreeBSD.ORG Subject: Re: kern/8375: pthread_cond_wait() spins the CPU Message-ID: <199810232330.QAA04810@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/8375; it has been noted by GNATS. From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> To: "Daniel M. Eischen" <eischen@vigrid.com> Cc: freebsd-gnats-submit@FreeBSD.ORG, jb@FreeBSD.ORG Subject: Re: kern/8375: pthread_cond_wait() spins the CPU Date: Sat, 24 Oct 1998 03:22:31 +0400 Daniel, IMO, your _thread_kern_sched_[un]lock() is a bad idea. Theses functions defeat the idea of spinlocks. What is the need to do _SPINLOCK/_SPINUNLOCK when scheduling is blocked? Your code do it a lot. OTOH, spinlocks are designed exactly to make rescheduling harmless. And they works; the only problem is that spinlocks are released in a bit wrong time. (BTW, why you disable scheduling in pthread_cond_signal and pthread_cond_broadcast?) The whole concept of disabling the scheduler is suspicious. There are data structures, they has to be locked sometimes to provide atomic access to them; why ever disable scheduling? Just lock and unlock properly... Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810232330.QAA04810>