From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23457 invoked from network); 4 Aug 2021 22:02:40 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Aug 2021 22:02:40 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id AA10C9CAB8; Thu, 5 Aug 2021 08:02:36 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5FC2A9CAA5; Thu, 5 Aug 2021 08:02:12 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id BD79C9CAA5; Thu, 5 Aug 2021 08:02:09 +1000 (AEST) Received: from mcvoy.com (mcvoy.com [192.169.23.250]) by minnie.tuhs.org (Postfix) with ESMTPS id 1B21D9CAA4 for ; Thu, 5 Aug 2021 08:02:09 +1000 (AEST) Received: by mcvoy.com (Postfix, from userid 3546) id 9A9E035E104; Wed, 4 Aug 2021 15:02:08 -0700 (PDT) Date: Wed, 4 Aug 2021 15:02:08 -0700 From: Larry McVoy To: Lawrence Stewart Message-ID: <20210804220208.GK9074@mcvoy.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [TUHS] Threads vs... not X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" >From http://mcvoy.com/lm/quotes.html A computer is a state machine. Threads are for people who can't program state machines. Alan Cox On Wed, Aug 04, 2021 at 05:48:46PM -0400, Lawrence Stewart wrote: > What do folks think about event-driven programming as a substitute for threads in UI and process control settings? > > I wrote the service processor code for the Sicortex Machines using libevent.a and I thought it was very lightweight and fairly easy to think about. (This was a thing running on ucLinux on a tiny 16 MB coldfire that managed the consoles and power supplies and temp sensors and JTAG access and booting and so forth.) > > Tk (IIRC) has a straightforward event driven model for UI interactions. > > Meanwhile, the dropbox plugin for my Mac has 120 threads running. WTF? > > This was triggered by the fork/spawn discussion. > > -Larry > (started with Unix at V6 on an 11/34) -- --- Larry McVoy lm at mcvoy.com http://www.mcvoy.com/lm