Results 1 to 5 of 5

Thread: QThread stack-address

  1. #1
    Join Date
    Nov 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QThread stack-address

    Greetings,

    I use Qt4 on Windows and I´m searching a way of getting the stack-address of a Qthread or
    set the stack myself.

    With pthreads it´s possible to get/set the stack-pointer by pthread_attr_getstack() and
    pthread_attr_setstack().
    Since QThreads are built upon pthreads there should be a solution but I only found
    QThread::setStackSize and i don´t like the idea of running a pthread in my QtApp only
    because of getting the address.

    Would be really thankful for getting some help

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread stack-address

    what kind of dirty tricks are you doing where you need the stack pointer?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Nov 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread stack-address

    All I want is to prevent the garbagecollection of my embedded interpreter running amok.

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread stack-address

    mmm, there isn't much GC happening in c++
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Nov 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread stack-address

    sorry if i didn´t express myself very good. i embedded a scriptinterpreter which is running in a qthread. and his garbagecollection needs to know the stack of the thread. otherwise it runs amok => http://bugs.ruby-lang.org/issues/2294

Similar Threads

  1. Replies: 1
    Last Post: 4th October 2012, 14:49
  2. Syncing QTextDocument's undo stack with custom undo stack
    By Dini Selimović in forum Newbie
    Replies: 0
    Last Post: 24th June 2012, 13:11
  3. stack, heap and C#
    By mickey in forum General Programming
    Replies: 8
    Last Post: 20th August 2007, 18:40
  4. stack
    By mickey in forum General Programming
    Replies: 7
    Last Post: 20th November 2006, 14:15
  5. QThread stack overflow when exiting
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 11th May 2006, 17:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.