Sponsored Content
Top Forums Programming Problem with POSIX pthreads and virtual memory Post 302222810 by shamrock on Thursday 7th of August 2008 01:44:56 PM
Old 08-07-2008
Quote:
Originally Posted by JEscola
yes, detach is inside client procedure..

static void* cliente(void *datos)
{
int id=pthread_self();
char *buff=(char *)malloc(100000);
sleep(15);
free(buff);
buff=NULL;
int error=pthread_detach(id);
printf("End Thread (%d)\r\n",error);
pthread_exit(NULL);

}
Well can you change it so that pthread_detach() is called from inside the function main().
 

10 More Discussions You Might Find Interesting

1. Programming

how can i avoid virtual memory problem

Hi i was trying to compile one of my project source file which is neary 2MB large. i couldnt compile it, instead getting an error like "insufficient virtual memory" how come i get away with this problem ,please suggest. thanks (1 Reply)
Discussion started by: Raom
1 Replies

2. Programming

Problem with pthreads

hi i have a code: I found that after exiting from child thread memory isn't freed. I commented everything which is "some actions" here, so thread's function contains only two lines. But it doesn't help. What do I do wrong? Thanks a lot (3 Replies)
Discussion started by: sery0ga
3 Replies

3. Programming

POSIX Thread - Memory leak

Hi all! I am implementing an http server in c++ using the posix thread, but i am having a memory leak and i cannot find the reason. I have already commented out the section that initializes the threads and i found out, the problem is when i initialize/run the threads. In the threads i have... (1 Reply)
Discussion started by: laurovalente
1 Replies

4. UNIX for Advanced & Expert Users

Shared Memory (Posix)

hi I had to create a shared memory segment which allows the creation of 8 child processes each with 1024 bytes and contains a common buffer area of 2096bytes. i was able to create the shared memory with shm_open() followed by ftruncate() and mmap() system calls. but for the shared buffer, i... (3 Replies)
Discussion started by: pretty
3 Replies

5. AIX

ulimits max locked memory virtual memory

Hi, Would any one be so kind to explain me : are ulimits defined for each user seperately ? When ? Specialy what is the impact of : max locked memory and virtual memory on performance of applications for a user. Many thanks. PS : this is what I can see in MAN : ulimit ] ... (5 Replies)
Discussion started by: big123456
5 Replies

6. UNIX for Dummies Questions & Answers

cpu, memory and virtual memory usage

Hi All, Does anyone know what the best commands in the UNIX command line are for obtaining this info: current CPU usage memory usage virtual memory usage preferably with date and time parameters too? thanks ocelot (4 Replies)
Discussion started by: ocelot
4 Replies

7. UNIX for Advanced & Expert Users

POSIX thread runs out of memory

i am creating threads in my program using the POSIX interface. when the thread starts executing i run out of memory and get a core dump. i have tried to increase the threads stack size using pthread_attr_setstacksize, but of no use since i guess the dynamic memory is allocated on the heap and... (1 Reply)
Discussion started by: aniketkadu2002
1 Replies

8. Programming

Memory LEAK with pthreads

I have this code... #include <stdio.h> #include <iostream> #include <pthread.h> static void* cliente(void *datos); int main() { pthread_attr_t tattr; int ret; size_t size = PTHREAD_STACK_MIN + 0x0100; ret = pthread_attr_init(&tattr); ret =... (8 Replies)
Discussion started by: JEscola
8 Replies

9. Programming

POSIX Message Queue Memory Allocation

Hi, I wanted to know whether the POSIX message queues are statically allocated memory by the kernel based on the parameters specified in the open or as and when we send messages, memory are allocated? Does the kernel reserve the specified memory for the message queue irrespective of whether... (1 Reply)
Discussion started by: sumtata
1 Replies

10. Solaris

Virtual Memory problem on local zone

Hi I have a problem with Virtual Memory on one local zone (myzone1): //from local zone (myzone1) swap -s total: 22888544k bytes allocated + 0k reserved = 22888544k used, 3325856k available swap -l swapfile dev swaplo blocks free /dev/swap ... (0 Replies)
Discussion started by: primo102
0 Replies
QwtTextEngine(3)						 Qwt User's Guide						  QwtTextEngine(3)

NAME
QwtTextEngine - Abstract base class for rendering text strings. SYNOPSIS
#include <qwt_text_engine.h> Inherited by QwtMathMLTextEngine, QwtPlainTextEngine, and QwtRichTextEngine. Public Member Functions virtual void draw (QPainter *painter, const QRect &rect, int flags, const QString &text) const =0 virtual int heightForWidth (const QFont &font, int flags, const QString &text, int width) const =0 virtual bool mightRender (const QString &text) const =0 virtual void textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const =0 virtual QSize textSize (const QFont &font, int flags, const QString &text) const =0 virtual ~QwtTextEngine () Protected Member Functions QwtTextEngine () Detailed Description Abstract base class for rendering text strings. A text engine is responsible for rendering texts for a specific text format. They are used by QwtText to render a text. QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library. QwtMathMLTextEngine can be found in Qwt MathML extension, that needs the MathML renderer of the Qt solutions package. Unfortunately it is only available with a commercial Qt license. See also: QwtText::setTextEngine() Constructor &; Destructor Documentation QwtTextEngine::~QwtTextEngine () [virtual] Destructor. QwtTextEngine::QwtTextEngine () [protected] Constructor. Member Function Documentation virtual void QwtTextEngine::draw (QPainter *painter, const QRect &rect, intflags, const QString &text) const [pure virtual] Draw the text in a clipping rectangle Parameters: painter Painter rect Clipping rectangle flags Bitwise OR of the flags like in for QPainter::drawText text Text to be rendered Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual int QwtTextEngine::heightForWidth (const QFont &font, intflags, const QString &text, intwidth) const [pure virtual] Find the height for a given width Parameters: font Font of the text flags Bitwise OR of the flags used like in QPainter::drawText text Text to be rendered width Width Returns: Calculated height Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual bool QwtTextEngine::mightRender (const QString &text) const [pure virtual] Test if a string can be rendered by this text engine Parameters: text Text to be tested Returns: true, if it can be rendered Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual void QwtTextEngine::textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const [pure virtual] Return margins around the texts The textSize might include margins around the text, like QFontMetrics::descent. In situations where texts need to be aligend in detail, knowing these margins might improve the layout calculations. Parameters: font Font of the text text Text to be rendered left Return value for the left margin right Return value for the right margin top Return value for the top margin bottom Return value for the bottom margin Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual QSize QwtTextEngine::textSize (const QFont &font, intflags, const QString &text) const [pure virtual] Returns the size, that is needed to render text Parameters: font Font of the text flags Bitwise OR of the flags like in for QPainter::drawText text Text to be rendered Returns: Caluclated size Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtTextEngine(3)
All times are GMT -4. The time now is 10:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy