From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52976 invoked by alias); 11 Nov 2016 11:54:49 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 52964 invoked by uid 89); 11 Nov 2016 11:54:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=blocked, H*i:sk:ec6450c, H*f:sk:ec6450c, 20161111 X-HELO: smtpo79.poczta.onet.pl Received: from smtpo79.poczta.onet.pl (HELO smtpo79.poczta.onet.pl) (141.105.16.29) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Nov 2016 11:54:38 +0000 Received: from INFERNUS (213-238-95-10.adsl.inetia.pl [213.238.95.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: freddie_chopin@op.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3tFdcj6kVjzSvDmWX for ; Fri, 11 Nov 2016 12:54:29 +0100 (CET) Message-ID: <1478865268.1232.1.camel@op.pl> Subject: Re: [PATCH, newlib] Allow locking routine to be retargeted From: Freddie Chopin To: newlib@sourceware.org Date: Fri, 11 Nov 2016 11:54:00 -0000 In-Reply-To: References: <1478792031.1254.1.camel@op.pl> <60acaa10-fb22-8655-fd67-0536fe359871@foss.arm.com> <1478809956.1322.1.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016/txt/msg01091.txt.bz2 On Fri, 2016-11-11 at 11:09 +0000, Thomas Preudhomme wrote: > Why do mutex needs to be more than a single integer? How big are > mutex in RTOS  > typically in your experience? Well, mutexes or things like that may be just a "int" in Linux or other "big" systems, where they are really just handles for data structures managed by the kernel. In "small" embedded RTOSes these object usually contain everything that is needed to implement the complete functionality, especially the linked list of threads that are blocked on this object. In my RTOS mutex is 28 bytes. In ChibiOS/RT mutex is 20 bytes. In FreeRTOS mutx is a monster with size of at least 70 bytes (depending on the config this can be a bit more). (above number are valid for 32-bit architectures) Regards, FCh