From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 30 05:06:37 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C87CD16A41C for ; Thu, 30 Jun 2005 05:06:37 +0000 (GMT) (envelope-from fbsd.hackers@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 655BD43D48 for ; Thu, 30 Jun 2005 05:06:37 +0000 (GMT) (envelope-from fbsd.hackers@gmail.com) Received: by rproxy.gmail.com with SMTP id i8so48430rne for ; Wed, 29 Jun 2005 22:06:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=B57d1ez0rnEBtX/d2ZDmzLbXHO7JpLrXzBCVi4X3Vefzbf0Jx8OXBOpY2xTa1g2XKndcwOKTtTVfHdrA2TBgRVnsTvgQYDFtM0Yl7ypuGkXLKfC/pgZEDFMlaioRWiEgh5wSK2qujG5Fl4a8GWSuZ3HK+2zRymC8FqY6euWGcPc= Received: by 10.38.181.12 with SMTP id d12mr335291rnf; Wed, 29 Jun 2005 22:06:36 -0700 (PDT) Received: by 10.38.11.46 with HTTP; Wed, 29 Jun 2005 22:06:36 -0700 (PDT) Message-ID: Date: Thu, 30 Jun 2005 01:06:36 -0400 From: Pablo Mora To: John Baldwin In-Reply-To: <200506290501.31301.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200506271318.36748.jhb@FreeBSD.org> <200506290501.31301.jhb@FreeBSD.org> Cc: freebsd-hackers@freebsd.org Subject: Re: problem handling POSIX thread on FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pablo Mora List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 05:06:37 -0000 >Not sure I understand the question. What do you mean by S.O? =20 , sorry by my badly english, the correct word is O.S (operative system). >you saying that since the threads are POSIX, that you would >expect the program to act the same on all Operating Systems? exactly, that thought before your answer. I thought that a same code was executed of the same form so much in Solaris, in GNU/Linux and FreeBSD. At least than had shown the same results. really I do not know because Linux and solaris they show me: hilo1: puntero contiene 0 hilo2: puntero contiene 0 hilo1: puntero contiene 0 hilo2: puntero contiene 3 hilo1: puntero contiene 2 hilo2: puntero contiene 6 hilo1: puntero contiene 4 hilo2: puntero contiene 9 hilo1: puntero contiene 6 hilo2: puntero contiene 12 hilo1: puntero contiene 8 hilo2: puntero contiene 15 hilo1: puntero contiene 10 hilo2: puntero contiene 18 hilo1: puntero contiene 12 hilo2: puntero contiene 21 hilo1: puntero contiene 14 hilo2: puntero contiene 24 hilo1: puntero contiene 16 finaliza hilo1 con id 1082231728 hilo2: puntero contiene 27 finaliza hilo2 con id 1090624432 fin hilo 2 sadly in my university we work with Solaris:' ( ---------------------------------------------------------------------------= ----------------------- I repeat part of the code: /* file: test.c */ .... #include char buffer[512]; pthread_mutex_t mutex, mutex2; pthread_t hilo1, hilo2; void f1(void* ptr) { int i,n=3D10; int valor=3D0; char*p=3D(char*)ptr; for(i=3D0;i