Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: (Execution) Termination bit, Alternation bit. Date: Sat, 19 Dec 2015 21:27:21 -0500 Organization: IISS Elusive Unicorn Lines: 59 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de BBbz1k6Yr7/TF2O6t1dcFgBQ8UkBRLeWe+OXjp/ENatw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'bits': 0.07; 'executed': 0.07; 'executes': 0.09; 'ignoring': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terminator': 0.09; 'thread': 0.10; 'cleanly': 0.16; 'itself;': 0.16; 'jumps': 0.16; 'multi-thread': 0.16; 'problem!': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'set;': 0.16; 'space)': 0.16; 'subject:bit': 0.16; 'memory': 0.17; 'alternate': 0.18; 'any,': 0.18; 'pointer': 0.18; 'processor': 0.18; 'url:home': 0.18; '2015': 0.20; 'code.': 0.23; 'bit': 0.23; '(or': 0.23; 'dec': 0.23; 'sat,': 0.23; 'sets': 0.23; 'sort': 0.25; 'header:X-Complaints-To:1': 0.26; 'points': 0.27; 'allocated': 0.27; 'tend': 0.27; 'idea': 0.28; 'skip:u 20': 0.28; 'looks': 0.29; 'pointer.': 0.29; 'termination': 0.29; 'instruction': 0.29; 'themselves': 0.29; 'typically': 0.29; "i'm": 0.30; 'work.': 0.30; 'code': 0.30; 'branch': 0.30; 'etc.)': 0.32; 'subject:) ': 0.32; 'run': 0.33; 'point': 0.33; 'changed': 0.33; 'enhanced': 0.33; 'flags': 0.33; 'behind': 0.35; 'execution': 0.35; 'follows:': 0.35; 'involving': 0.35; 'path': 0.35; 'level': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; '(and': 0.36; 'structures': 0.36; 'to:addr:python-list': 0.36; 'two': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'itself': 0.38; 'stuff': 0.38; 'shared': 0.38; 'why': 0.39; 'data': 0.39; 'resources': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'software': 0.40; 'high': 0.60; 'your': 0.60; 'leaving': 0.63; 'more': 0.63; 'safe': 0.63; 'information': 0.63; 'better.': 0.66; 'act': 0.67; 'transfer': 0.73; 'low': 0.83; 'activation.': 0.84; 'cohesion': 0.84; 'execution.': 0.84; 'here...': 0.84; 'dennis': 0.91; 'killed': 0.91; 'task,': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-79-218-140.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:100619 On Sat, 19 Dec 2015 18:56:17 +0100, "Skybuck Flying" declaimed the following: >Hello, > >I'd like to see instruction execution enhanced with the following two ideas: > >1. A termination bit, and a terminator pointer. >2. A alternation bit, and a alternate pointer. > >The purpose of these bits is as follows: > >Before a processor/core executes an instruction both bits are examined. > >1. If the termination bit is set the instruction is not executed and instead >the processor sets the instruction pointer to the termination pointer. >2. If the alternation bit is set the instruction is not executed and instead >the processor sets the instruction pointer to the alternation pointer. > >The idea behind this is support multi threading/parallelism better. > Don't see it here... You've just enabled leaving lots of corrupted data structures in the system... (Imagine your "termination" branch is taken after a call that allocated a 500MB block of memory, but before the call that returns that memory to the system). This is why all well-designed multi-thread (and even multi-process -- though processes are typically an OS level entity which can be killed and all resources reclaimed as they are not in a shared memory space) tend to rely upon known points of communication and signalling. One of the bedrocks of software engineering has been the concepts of cohesion and coupling. High cohesion: a block (function, etc.) of code is focused upon a task, not containing bits of stuff involving multiple unrelated work. Low coupling: blocks are independent of other blocks, with only a few known points of information transfer -- few, if any, side-effects, no mysterious globals... They should be black-boxes whose inner content can be changed without affecting any other code. Your externally inflicted bits and jumps violate all of these as they require outside code to know what the inside looks like to make safe use of them. The "bits" are not the problem, but the uncontrolled/asynchronous transfer of control is a big problem! The "bits" themselves are nothing more than a recreation of VMS Event Flags (or even AmigaOS signal bits) -- they can be asynchronously set; but to act upon them requires a synchronous operation*... That is, some sort of read operation in a loop or at other known code points at which the code itself can cleanly change its path of execution. * I'm ignoring ASTs -- software interrupts -- since they don't cause a transfer of control of the thread itself; they activate, run quickly, and return to the point of activation. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/