Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!rochester!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!dwp From: dwp@willett.pgh.pa.us (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: of peasants and queues and dataflow Message-ID: <1800.UUL1.3#5129@willett.pgh.pa.us> Date: 4 Oct 90 00:32:08 GMT References: <1990Sep26.084008.8616@idacom.uucp> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 31 In <1990Sep26.084008.8616@idacom.uucp>, rob@idacom.uucp (Rob Chapman) writes: [I don't remember any longer who the '> >' should attributed to. -dwp] > >As far as I can see, the main problem in parallelism is the efficient > >communication of data and instructions between processors. Stacks are an > >efficient way of passing data between words (tasks, subroutines, whatever); > >perhaps there's some way of passing data and/or instructions between processors > >using stacks. > > The natural complement to stacks (LIFOs) in Forth, are queues (FIFOs). > These may be used for efficient communication between processors. I think the issue of efficiency is a red herring here. The reason that stacks are so wonderful for a single thread of execution is because words run time behaviour "nests" in a way that stacks support (or visa versa). If you want to do co-routines or lightweight processes in Forth or even multi-user Forth, each thread/user must get its own stack, user variables, etc. I would suspect that there would be a direct mapping of useful techniques from multiple process/user Forth implementations into Multiple processor/process/user Forth implementations. I think the stack paradigm that makes Forth a powerful single threaded language is just not suitable for a multiprocess environment. I think Rob's queues are an interesting idea. Message Passing systems typically use that paradigm. I would suggest that the philosophy of Forth's stack is not directly applicable, but is applicable in kind. The thing to choose will be to multiprocess(or) Forth what stacks are to single process Forth. -Doug --- Preferred: dwp@willett.pgh.pa.us Ok: {pitt,sei,uunet}!willett!dwp