Results 1 to 6 of 6

Thread: State Machines

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    State Machines

    Working on a state machine which requires re-entrant code.

    Anyone had any experience with State Machines -- would like
    to discuss??

  2. #2
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736
    would you mind explaining what a state machine is?

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    Definition: A model of computation consisting of a set of states, a start state, an input alphabet, and a transition function that maps input symbols and current states to a next state. Computation begins in the start state with an input string. It changes to new states depending on the transition function. There are many variants, for instance, machines having actions (outputs) associated with transitions (Mealy machine) or states (Moore machine), multiple start states, transitions conditioned on no input symbol (a null) or more than one transition for a given symbol and state (nondeterministic finite state machine), one or more states designated as accepting states (recognizer), etc.

    Also known as finite state automaton.
    also known as:

    Turing machine
    (definition)

    Definition: A model of computation consisting of a finite state machine controller, a read-write head, and an unbounded sequential tape. Depending on the current state and symbol read on the tape, the machine can change its state and move the head to the left or right. Unless otherwise specified, a Turing machine is deterministic.
    I remember the Turing Machine from Data Processing 101.
    I'm not sure if this is what he meant or not, but decided to GOOGLE it to see.


  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174
    Turing Machines was probably the single most interesting subject in college. After AI/NN of course.

    I especially liked the Halting problem...

  5. #5
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,712
    I 've designed state machines for PLD's. I'll help if I can
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166
    Thanks for the response kebo

    Believe "for the most part" I've got it working. From what I've seen you can break down your reentrant code to the nth level
    so limited mine reentrant code to any processing > 1 second.

    I'm using a database as a circular buffer. Data is received from a server, where it is stored in the DB (master record table) and also the DB Buffer. No locks are used on the buffer table

    A timer is used to query the buffer to process the records and if an outside event occurs (e.g. User using mouse) state machine enters a reentrant state until action is completed.

    QUESTION:

    Will the following cause a data loss or is there some work around??

    I'm writing to the buffer using Recordset 1 (this is set to read/write and the write is initiated by receipt of data from server which I receive in a continuous stream and which I have no control over).

    I am reading from the buffer using Recordset 2 (this is set as read/write and the read is timer initiated).

    NO LOCKING is currently used.

    To date I have had no problems but concerned that if if NO records exist in the buffer and if Recordset1 tries to write to the buffer at the same time Recordset2 tries to read it, a conflict will occur.
    Last edited by dw85745; Aug 30th, 2004 at 05:45 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width