Python thread.stack_size() Examples

The following are 19 code examples of thread.stack_size(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module thread , or try the search function .
Example #1
Source File: test_thread.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def test_stack_size(self):
        import sys
        if is_cli or (sys.version_info[0] == 2 and sys.version_info[1] > 4) or sys.version_info[0] > 2:
            import thread
            
            size = thread.stack_size()
            self.assertTrue(size==0 or size>=32768)

            bad_size_list = [ 1, -1, -32768, -32769, -32767, -40000, 32767, 32766]
            for bad_size in bad_size_list:
                self.assertRaises(ValueError, thread.stack_size, bad_size)
                
            good_size_list = [4096*10, 4096*100, 4096*1000, 4096*10000]
            for good_size in good_size_list:
                #CodePlex Work Item 7827
                if is_cli and good_size<=50000: print "Ignoring", good_size, "for CLI"; continue
                temp = thread.stack_size(good_size)
                self.assertTrue(temp>=32768 or temp==0)
            
            def temp(): pass
            thread.start_new_thread(temp, ())
            temp = thread.stack_size(1024*1024)
            self.assertTrue(temp>=32768 or temp==0) 
Example #2
Source File: dummy_thread.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #3
Source File: dummy_thread.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #4
Source File: dummy_thread.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #5
Source File: dummy_thread.py    From canape with GNU General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #6
Source File: dummy_thread.py    From unity-python with MIT License 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #7
Source File: dummy_thread.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #8
Source File: thread.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def stack_size(size=None):
        if size is None:
            return _original_stack_size()
        if size > _original_stack_size():
            return _original_stack_size(size)
        else:
            pass
            # not going to decrease stack_size, because otherwise other greenlets in this thread will suffer 
Example #9
Source File: thread.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def stack_size(size=None):
        if size is None:
            return _original_stack_size()
        if size > _original_stack_size():
            return _original_stack_size(size)
        else:
            pass
            # not going to decrease stack_size, because otherwise other greenlets in this thread will suffer 
Example #10
Source File: dummy_thread.py    From RevitBatchProcessor with GNU General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #11
Source File: dummy_thread.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #12
Source File: dummy_thread.py    From meddle with MIT License 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #13
Source File: dummy_thread.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #14
Source File: dummy_thread.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #15
Source File: thread.py    From satori with Apache License 2.0 5 votes vote down vote up
def stack_size(size=None):
        if size is None:
            return _original_stack_size()
        if size > _original_stack_size():
            return _original_stack_size(size)
        else:
            pass
            # not going to decrease stack_size, because otherwise other greenlets in this thread will suffer 
Example #16
Source File: dummy_thread.py    From oss-ftp with MIT License 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #17
Source File: dummy_thread.py    From Computable with MIT License 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #18
Source File: dummy_thread.py    From BinderFilter with MIT License 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0 
Example #19
Source File: dummy_thread.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def stack_size(size=None):
    """Dummy implementation of thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0