GithubHelp home page GithubHelp logo

thread is blocked unexpectly about chezscheme HOT 3 CLOSED

yjqww6 avatar yjqww6 commented on August 18, 2024
thread is blocked unexpectly

from chezscheme.

Comments (3)

yjqww6 avatar yjqww6 commented on August 18, 2024

I tested it on 64-bit Linux, the code work as expected and didn't block.

from chezscheme.

dybvig avatar dybvig commented on August 18, 2024

I believe the problem is that the WIN32 definition of s_ee_read_char in expeditor.c is not deactivating the thread before calling (and possibly blocking on) ReadConsoleInput. When the background thread, which is busily creating and dropping bignums once i gets out of fixnum range, detects it's time to do a collection, the blocked but still active main thread prevents the collection from occurring, effectively blocking the background thread as well. You can verify this is the problem by setting collect-notify to #t and seeing if collections stop after a while. Or you can go ahead and insert calls to deactivate_thread and reactivate_thread around the call to ReadConsoleInput (following the pattern in the non-WIN32 definition of s_ee_read_char) and see if that fixes the problem.

In the 64-bit version, i wouldn't have exceeded the fixnum range in your test (assuming no time travel), so no bignums were allocated, and no collections were needed.

from chezscheme.

yjqww6 avatar yjqww6 commented on August 18, 2024

@dybvig I have modified the code according to your words and recompiled it, and it seems the problem do not occurs anymore.

from chezscheme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.