Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Thread stack size

    Scheduled Pinned Locked Moved WiPy 2&3
    4 Posts 3 Posters 1.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      toribios_people
      last edited by

      Hi,

      I'm quite new to the wipy, and I was experimenting today with threads. My question is about the threads stack size.

      Using _thread.stack_size([size]) doesn't seem to have any effect while creating the threads, as indepently from specifyed size, I never run into an error.
      The problem comes when I have more than three active threads, every time I start the fourth thread, I run into this error:
      MemoryError: memory allocation failed, allocating 6144 bytes
      Is it possible to run more than three simultanious threads? Am I specifying the stack size wrongly?

      Thanks.

      D 1 Reply Last reply Reply Quote 0
      • D Offline
        daniel @toribios_people
        last edited by

        @toribios_people Welcome to the forum!

        Let us have a look at this problem and I'll get back to you shortly. Thanks.

        T 1 Reply Last reply Reply Quote 0
        • T Offline
          toribios_people @daniel
          last edited by

          @daniel I have seen that you fixed this problem on 1.2.2.b1, but anything below 4096 for the stack size, seems to be ignored. Is this the minimum stack size? Even if the task of the tread is very simple? Thanks.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            Shaun @toribios_people
            last edited by Shaun

            @toribios_people Yes, 4096 is the minimum settable stack size.
            https://docs.pycom.io/pycom_esp32/library/thread.html

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom