Re: FYI: AI-programmer

Discussion in 'Python' started by Andrew Robinson, Feb 22, 2013.

  1. On 02/22/2013 08:23 PM, Ian Kelly wrote:
    > On Fri, Feb 22, 2013 at 5:09 AM, Andrew Robinson
    > <> wrote:
    >> On 02/22/2013 07:21 PM, Ian Kelly wrote:
    >>> I am curious about how he deals with infinite loops in the generated
    >>> programs. Probably he just kills the threads after they pass some
    >>> time threshold?

    >> I'm under the impression that Python doesn't really allow you to kill a
    >> thread after a time period.
    >> It's not portable to do so....

    > He's using C#, not Python. And anyway, you can cooperatively request
    > threads to shut down; just have the Brainfuck interpreter thread check
    > for a shutdown request every N cycles, or even just place the timeout
    > in the interpreter thread itself.

    -----
    1st)
    It's still surprising that even C# would allow a killing of threads.

    Resources can be allocated by a thread and tied up was one of the
    comments made on the site I linked; so those resources could be
    permanently tied up until process exit if the thread is killed.

    eg: killing a thread is different from killing the process it is running in.

    I'm not familiar enough with C# to know if it does garbage collection or
    not, or how de-allocation is handled; so perhaps I missed something.

    ------
    2nd)

    How would you get an interpreter thread to check for a shutdown request
    every N cycles?
    I've read about how to set a timeout based on time, but not on any kind
    of cycle (eg: instruction cycle?) count.

    Do you have a python example?
    Thanks!
     
    Andrew Robinson, Feb 22, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gisle Vanem

    FYI: AI-programmer

    Gisle Vanem, Feb 22, 2013, in forum: Python
    Replies:
    0
    Views:
    85
    Gisle Vanem
    Feb 22, 2013
  2. Chris Angelico

    Re: FYI: AI-programmer

    Chris Angelico, Feb 22, 2013, in forum: Python
    Replies:
    0
    Views:
    98
    Chris Angelico
    Feb 22, 2013
  3. Gisle Vanem

    Re: FYI: AI-programmer

    Gisle Vanem, Feb 22, 2013, in forum: Python
    Replies:
    1
    Views:
    79
    Neil Cerutti
    Feb 22, 2013
  4. Ian Kelly

    Re: FYI: AI-programmer

    Ian Kelly, Feb 22, 2013, in forum: Python
    Replies:
    0
    Views:
    114
    Ian Kelly
    Feb 22, 2013
  5. Andrew Robinson

    Re: FYI: AI-programmer

    Andrew Robinson, Feb 22, 2013, in forum: Python
    Replies:
    0
    Views:
    59
    Andrew Robinson
    Feb 22, 2013
Loading...

Share This Page