You would get that error if for example you compiled without -lpthread. My thought is that it really did not (re)compile correctly. make will not recompile something if it thinks the executable is "current"
Minor correction. The program wouldn't compile, and the linker would issue an error like:
Here the problem occurs at runtime. Your thought seems correct.
Quote:
Originally Posted by SuperStout
Sorry i didnt post this earlier, but i know why i had that error, it wasnt any compiler error, it was beacuse the way i had that i was creating that thread over and over again in an infinit loop. a litle error in my code but al fixed now. thx anyway.
You may need indeed to fix this additional error. However, it is rather unlikely to have something in common with the problem you have initially reported. Jim's likely right; a clean recompile may have resolved your "undefined symbol" problem.
I have trouble compiling a pthread program on unix system which suppotrs pthreads it gives
unresolved
_pthread_create
_pthread_exit
error.
what to do? (1 Reply)
consider if the thread routine returns any void pointer while calling pthread_join,
the thread resources are freed and the thread will be terminated when the main thread is exit ,that is my assumption whether it is true
how do we find whether the thread is alive or terminated
how do we find... (0 Replies)
When I use some of the pthread functions: pthread_join, pthread_exit they work perfect. But when I look in the pthread.h file I can't seem to find any implementations of the functions...where are they hiding?? (2 Replies)
Hello,
I run my pthread code on Linux with 4 processors. However, the speed up is only 2 times.
The code is about solving equation (G+s(i)C)z(i)=B*us(i), i=1,...,n. Here G,C are m*m matrix, B*us(i) is a m*1 vector and s(i) are n different numbers. I need to solve the equation n times to... (2 Replies)
Hi all,
How can i parallize this code in pthread?
for(round=1;round<=16;round++)
{
Expansion(mid, 17 - round - 1, left);
Expansion(mid, round - 1, right);
round++;
Expansion(right, 17 - round - 1, mid);
Expansion(left, round - 1,mid);
}
Whereby each loop depend on the... (2 Replies)
I am so confused about the user threads and kernel threads.Suppose I created a thread using pthread create call in Linux ,whether it will be a user thread or kernel thread.If it user thread,then how its map to kernel thread.
I heard about the M:1,M:N,1:1 mapping methods.Which method linux is... (1 Reply)
I have a while loop like so:
while (counter (file1));
how can I pass that into a pthread_create()?
I was thinking ...
while(pthread_create(&path, NULL, counter, file));
is that right? (1 Reply)
Discussion started by: l flipboi l
1 Replies
LEARN ABOUT OPENDARWIN
tcl_mem_debug
TCL_MEM_DEBUG(3) Tcl Library Procedures TCL_MEM_DEBUG(3)__________________________________________________________________________________________________________________________________________________NAME
TCL_MEM_DEBUG - Compile-time flag to enable Tcl memory debugging.
_________________________________________________________________DESCRIPTION
When Tcl is compiled with TCL_MEM_DEBUG defined, a powerful set of memory debugging aids are included in the compiled binary. This
includes C and Tcl functions which can aid with debugging memory leaks, memory allocation overruns, and other memory related errors.
ENABLING MEMORY DEBUGGING
To enable memory debugging, Tcl should be recompiled from scratch with TCL_MEM_DEBUG defined. This will also compile in a non-stub version
of Tcl_InitMemory to add the memory command to Tcl.
TCL_MEM_DEBUG must be either left defined for all modules or undefined for all modules that are going to be linked together. If they are
not, link errors will occur, with either TclDbCkfree and Tcl_DbCkalloc or Tcl_Ckalloc and Tcl_Ckfree being undefined.
Once memory debugging support has been compiled into Tcl, the C functions Tcl_ValidateAllMemory, and Tcl_DumpActiveMemory, and the Tcl mem-
ory command can be used to validate and examine memory usage.
GUARD ZONES
When memory debugging is enabled, whenever a call to ckalloc is made, slightly more memory than requested is allocated so the memory debug-
ging code can keep track of the allocated memory, and eight-byte ``guard zones'' are placed in front of and behind the space that will be
returned to the caller. (The sizes of the guard zones are defined by the C #define LOW_GUARD_SIZE and #define HIGH_GUARD_SIZE in the file
generic/tclCkalloc.c -- it can be extended if you suspect large overwrite problems, at some cost in performance.) A known pattern is writ-
ten into the guard zones and, on a call to ckfree, the guard zones of the space being freed are checked to see if either zone has been mod-
ified in any way. If one has been, the guard bytes and their new contents are identified, and a ``low guard failed'' or ``high guard
failed'' message is issued. The ``guard failed'' message includes the address of the memory packet and the file name and line number of
the code that called ckfree. This allows you to detect the common sorts of one-off problems, where not enough space was allocated to con-
tain the data written, for example.
DEBUGGING DIFFICULT MEMORY CORRUPTION PROBLEMS
Normally, Tcl compiled with memory debugging enabled will make it easy to isolate a corruption problem. Turning on memory validation with
the memory command can help isolate difficult problems. If you suspect (or know) that corruption is occurring before the Tcl interpreter
comes up far enough for you to issue commands, you can set MEM_VALIDATE define, recompile tclCkalloc.c and rebuild Tcl. This will enable
memory validation from the first call to ckalloc, again, at a large performance impact.
If you are desperate and validating memory on every call to ckalloc and ckfree isn't enough, you can explicitly call Tcl_ValidateAllMemory
directly at any point. It takes a char * and an int which are normally the filename and line number of the caller, but they can actually
be anything you want. Remember to remove the calls after you find the problem.
SEE ALSO
ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
KEYWORDS
memory, debug
Tcl 8.1 TCL_MEM_DEBUG(3)