From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jan Wielkiewicz Newsgroups: gmane.lisp.guile.user Subject: Re: guile fibers - looking for adivce Date: Mon, 7 Sep 2020 18:34:40 +0200 Message-ID: <20200907183440.3407cd18@interia.pl> References: <20200906024757.58dd34cd@interia.pl> <8f3fb4a5-4bad-4ebf-77bf-78826fdbc996@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1990"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Sep 07 16:35:12 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFIEg-0000Gx-21 for guile-user@m.gmane-mx.org; Mon, 07 Sep 2020 16:35:10 +0200 Original-Received: from localhost ([::1]:47136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFIEf-0006AR-4D for guile-user@m.gmane-mx.org; Mon, 07 Sep 2020 10:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFIES-00068d-Rb for guile-user@gnu.org; Mon, 07 Sep 2020 10:34:56 -0400 Original-Received: from smtpo.poczta.interia.pl ([217.74.65.237]:54499) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFIEQ-00087u-8T for guile-user@gnu.org; Mon, 07 Sep 2020 10:34:56 -0400 X-Interia-R: Interia X-Interia-R-IP: 89.64.43.25 X-Interia-R-Helo: Original-Received: from localhost (89-64-43-25.dynamic.chello.pl [89.64.43.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA; Mon, 7 Sep 2020 16:34:48 +0200 (CEST) In-Reply-To: <8f3fb4a5-4bad-4ebf-77bf-78826fdbc996@posteo.de> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1599489288; bh=o4r5NDQMR3iPHsURUzFObWB5SuAftHk7jshCzgb+JjU=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailer:MIME-Version: Content-Type:Content-Transfer-Encoding:X-Interia-Antivirus; b=SIpfyPX6V5dIOTblld6Jc8u8ZRv64trirfFYlLT66Yu0ygloSCehygO4+s3Azux3E VPlhhjQDUJLzVaUgwPWTaLCx6ewmMC8xSHZPk+LILKDYZ6TXGF7+ulnxUDFbKxB+BD RNJN7NJ6WBd+0gPO94kYyAdVvbuqWx90dpWHZ3qo= Received-SPF: pass client-ip=217.74.65.237; envelope-from=tona_kosmicznego_smiecia@interia.pl; helo=smtpo.poczta.interia.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/07 10:34:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16876 Archived-At: Hi! Dnia 2020-09-06, o godz. 02:42:20 Zelphir Kaltstahl napisa=C5=82(a): > Hi Jan! > > Call me uneducated, but I believe, if you are accessing shared memory, > in this case the shared member vector of the object, you will have to > resort to things like locking mechanisms. I don't know of any other > way, except for not using shared memory and keeping one copy per > fiber or per concurrently running execution unit. I'll probably go with some locking mechanism then. > Is there a way you could avoid sharing the object? Perhaps copying it > for each fiber? Fortunately, at least for now, one procedure updates the array and the other only reads it. We'll see how scalable is my idea when the project grows.=20 > If not, then perhaps there is yet another way. A while ago I read some > article, which had the heading "pull not push" or something. So > instead of having multiple concurrent execution units trying to > update the vector, perhaps you could have multiple concurrent > execution units, which are each responsible for some exclusive part > of the state of a data structure and working on their own parts of > the memory of it and update it by retrieving information from the > system. Perhaps this is clearer, if I link to the article I read: Sounds interesting, thanks. Maybe I'll find use for this later. > https://nullprogram.com/blog/2020/04/30/ >=20 > This might only work in cases, where the data lends itself to such > "other way around" of updating state. >=20 > > Thanks in advance > > Jan Wielkiewicz >=20 > Out of ideas for now. >=20 > Regards, > Zelphir >=20 >=20 Anyway, thanks for ideas. Jan Wielkiewicz