Programming :: Prevent Process Crashing On Thread Crash?

Mar 24, 2011

I want to know, is there any way to prevent the multi-thread process from crashing if some errors (say, segmentation faults) occur in one of its child threads? I've found pthread_sigmask() function, but that does not seem to work:

Code:
#include <stdio.h>
#include <unistd.h>

[code]...

View 3 Replies


ADVERTISEMENT

Programming :: Get List Of Thread In Running Process?

Jan 27, 2010

How to get list of threads of a process using C code in Linux?

View 6 Replies View Related

Programming :: Expect: Prevent Output From Spawned Process To Appear On Stdout?

Jul 3, 2009

I have this expect process:

Code:
spawn -noecho telnet my.host.com
expect {

[code]...

View 3 Replies View Related

Programming :: How To Bind Thread To Specific Thread In Multithread Application?

Dec 25, 2010

I am going to use "pthread_setaffinity_np" to bind a thread to a specific core. My application has two threads. I have used mutex to assign a specific id to each thread and then bind that thread to a core different from another core. but it seems that the os assigns both thread to one core.What should I do to bind each thread to a specific core?

View 4 Replies View Related

General :: Get List Of Thread Of Running Process Using C Api (in That Code)?

Jan 29, 2010

In short our required is that we are creating a share library which can be loaded by a process and that share library analysis the process which load it. Since share library is in address space of the process so I need to find out how many threads created by the process and what is status of their stack trace etc.

So I am looking for a way to get list of threads in running process.

View 1 Replies View Related

Software :: Read Process/thread Schedule Information?

Nov 18, 2009

is there any tool can show the thread/process schedule information? i would like to know when the thread/process wakeup, and when it was suspend? it includes kernel and user space. With this information, i can know the thread/process task schedule, and calculate the MIPs.Another, do you know whether LTT support User space thread trace?

View 2 Replies View Related

General :: Stop Thread By Using Commands - Process Shouldn't Disturbed

Feb 12, 2010

How to stop a thread by using commands? Other threads in that process shouldn't disturbed. Is it possible to do the same?

View 2 Replies View Related

General :: Prevent Restarting The Application After It's Crash?

Apr 1, 2010

Code:
#!/bin/bash
ulimit -c unlimited
while true; do ./executeable; done

When i will write this in console it will run executeable file and it will generate report : core.pid after crash so i can gdb the report. The application after crash will restart how can i prevent restarting the application after it's crash?

View 2 Replies View Related

Programming :: Unix Programming - Single Thread Server Can Support Exactly 2 Clients At Once

Sep 28, 2010

A simple TCP based chat server could allow users to use any TCP client (telnet, for example) to communicate with each other. For this question you should consider a single process, single thread server that can support exactly 2 clients at once, the server simply forwards whatever is sent from one client to the other (in both directions). Your server must not insist on any specific ordering of messages as soon as something is sent from one client it is immediately forwarded to the other client. As soon as either client terminates the connection the server can exit

View 4 Replies View Related

General :: How To Prevent A Process Starting

Jul 7, 2011

I have synergyc process that starts at boot. How do I prevent this process from starting? I've searched /etc, /etc/init.d for some configs or scripts but found nothing.

View 2 Replies View Related

Ubuntu :: STD Process Keeps Crashing Network?

Apr 14, 2011

There is a process called STD that uses 90 plus percent of the cpu. If its running when I plug into the network the network crashes. Also can't watch movies our do anything requiring the processor while its running.

View 1 Replies View Related

General :: SIGABRT Crashing A Process

Jan 19, 2011

I have an application where multiple processes talk to each other.One of the process is crashing repeatedly via a SIG ABRT signal, I have tried to put in a gdb on that process and tried to figure out what the stack is at the point of the crash.the stack.

View 1 Replies View Related

Software :: Process Crashing With No Core File?

May 14, 2011

A process from some software I am running keeps crashing with seemingly no real pattern. I ahve tried using ddd/gdb to run the process in question but everytime it crashes no useful information is returned. I also tried getting a core file with the same result. It seems as though according to linux the program has exited normally.

This obviously points towards the process itself having a bug but there are other instances of the same program running on other machines in the network with no problems at all.

I have made comaprisons of hardware/drivers (lspci etc) installed on various machines and all are exactly the same as the machine in question so my question is (at long last): What else should I be looking for?

View 3 Replies View Related

General :: Difference Between Child THREAD And Child PROCESS?

Jul 30, 2009

I am troubleshooting something and I got this problem.

If I do "pstree -p"

It shows,

Code:

[code]....

However, it does NOT show up in "ps -elf"

Code:

ps -elf | grep soffi
0 S whho 7734 1 0 80 0 - 36435 - 11:14 pts/2 00:00:03 /usr/lib/openoffice/program/soffice.bin -splash-pipe=5
0 S whho 7833 7759 0 80 0 - 751 - 11:21 pts/3 00:00:00 grep soffi

I was wondering if 7735, 7736, 7737, 7743 were really processes. Then I checked /proc, I could cd to /proc/7735, /proc/7736, etc, but I could not ls them out. I looked at the man page of "pstree", it says,

Code:

Child threads of a process are found under the parent process and are shown with the process name in curly braces, e.g.

icecast2---13*[{icecast2}]

So, what does all this mean? Does it mean that 7735, 7736, 7737, 7743 are just threads but not processes? If so, why could I cd to /proc/<id> but not see them in "ps -elf".

View 10 Replies View Related

Programming :: Quickest Way To Get Thread Id

Jun 24, 2010

What is the quickest way to get the thread id(tid) of the current thread in linux? Specifically I use fedora 13. ...and I am talking about inside a C++ program.

View 2 Replies View Related

Programming :: Determine What CPU Thread Is On?

Jul 2, 2010

Is there a library/system call that will return to me what CPU core a thread of execution is running on? I've looked for a bit on the net already and also in /usr/include and couldn't find one.

getcpu() and sched_getcpu() are two that I found, but when I include the appropriate header files (linux/getcpu.h, and sys/sched.h respectively), gcc says getcpu.h doesn't exist and the linker complains it cannot find the implementation in sched.h.

I'm sure I'm doing something really stupid or overthinking...

What I am doing is running an OpenMP application and specifying a list of cpu cores to run on with GOMP_CPU_AFFINITY. I want to make sure that each core is getting the same number of threads.

**UPDATE**

It seems that this code works, but only with glibc >= 2.6, and my machine has 2.5:

Code:
#define _GNU_SOURCE
#include <stdio.h>
#include <utmpx.h>
int main( void )

[Code].....

View 3 Replies View Related

Programming :: Thread Scheduling And Signalling

Mar 23, 2010

I have a program which is uses sigaction to register for a SIGIO signal (for incoming data on a fd) with an appropriate event handler. I also create a new detached thread 'B' that does some work with the received data. Normally the thread B runs properly. But when my event handler is called (because a there is new incoming data), after the event is handled, the thread B is not called immediately. There is a noticeable delay of the order of many seconds before it is scheduled again .During this delay, my program is doing nothing.

What am i doing wrong? Is there someway i can run thread B as soon as the event is handled (and assuming no other work is to be carried out)?

View 3 Replies View Related

Programming :: Close The Thread Externally?

Aug 11, 2010

i created one thread in main(). I have while in thread function.

I want close the thread in main after some time. How can i close it.

View 4 Replies View Related

Programming :: How To Make Thread Nicer?

Feb 16, 2010

Kernel: 2.6.24.2
System: Embedded System

I have a process and two threads running in it. Thread1 is my GUI-Thread (using FLTK) and Thread2 is running at the first 10 sec. after start.Now, I would like to make Thread2 "nicer" to Thread1, because otherwise GUI stucks sometimes. But I didn't find a solution.Is it possible to define the "niceness" of threads inside a process (to each other)? And if so, how do I have to do this?

View 2 Replies View Related

Programming :: Passing Data To A New Thread?

Feb 11, 2011

I have to launch a new thread from my existing main program and pass data to it.
For now the data is simply a string value.

How I go about passing data to a new thread while it is running.

View 5 Replies View Related

Programming :: Thread Stack Using Pthread_attr_setstackaddr()?

Sep 22, 2010

When I set the stack base address of the child thread using the POSIX library function "pthread_attr_setstackaddr()", I am unable to access the memory contents of its parent. The data-structures that are created on the HEAP of its parent using malloc() are either getting destroyed or unaccessible when moving to the context of the child thread. These data-structures are being passed as an argument to the child thread.Even if I make these variables global then also it is not working.pthread_attr_setstacksize(tattr, ...);stackbase = (void *) malloc(...);pthread_attr_setstackaddr(tattr, stackbase);But when I create the child thread without setting its stack base address using that pthread_attr_setstackaddr(), then it is able to access the parent's memory contents.

View 1 Replies View Related

Programming :: Counting Context Switches On Thread?

Jun 10, 2010

I have done some searching around the internet and this site, but I haven't found a good way to count the context switches on a thread in a c++ program I am running. I need to know if it get swapped off of a CPU for correct timing.

View 4 Replies View Related

Programming :: Which Is Scheduling Algorithm Which Will Make Thread O?

May 4, 2011

I have a timer thread, and when it expires, it sets a flag. The only problem is, if any higher priority thread comes in between, then the timer is not expired in real time.Thus i want to set a highest priority to my thread. Now, i know 2 algos, which can make my thread in real time are: SCHED_FIFO and SCHED_RR.

So, here are my queries: 1) Which scheduling algo is best suited for this purpose? 2) Is it guaranted to work in real time if i use that algo (you suggest in 1) and set the max_priority by getting the maximum settable priority for that particular algorithm using, int sched_get_priority_max(int policy);

View 2 Replies View Related

Programming :: Change Priority When Creating New Thread?

Feb 21, 2010

I have created an error logger thread in my application using pthread_create(), I want this thread to have a lower priority than my application's priority so that the application would run properly. Is there an easy way to do this? I know that we can change priority for thread created with policies FIFO or RR, since I don't set the policy for my application, I don't know what to set for my thread.

View 4 Replies View Related

Programming :: Suspend/resume A Thread When Using Pthread.h?

Dec 14, 2010

I want to suspend/resume a thread. The library I am using is pthread.h.I am also running my application on linux.Is there any function in pthread. let me suspend a thread temporary?I have read a document in which it was mentioned thatthread does not support suspend/resume

View 4 Replies View Related

Programming :: Increasing Thread Stack Size?

Jan 23, 2011

I seem to only be able to set my stack size on my linux server to 15000. If I increase it to 20000 I get a Segmentation Fault. how I can get the linux OS to increase the stack size? Code: threadRet |= pthread_attr_setstacksize( &m_ThreadAttributes, 15000 );

View 8 Replies View Related

Programming :: Is Popen Thread Safe Via Pthreads?

Sep 17, 2010

I don't seem to find a conclusive answer to this one...."Is popen thread safe via pthreads?"

View 2 Replies View Related

Programming :: Need To Find Appropriate Thread Scheduling And Priority

Sep 9, 2009

I am new to thread programming. I need to generate one thread in one process using posix thread. Which scheduling and priority do i need to use? I want to generate the thread with the lowest priority. As i know there are 3 scheduling policy available SCHED_FIFO, SCHED_RR or SCHED_OTHAR.

View 1 Replies View Related

Programming :: Passing An Object To A Running Thread?

Jan 14, 2011

This is a client server issue where the server creates a new thread for listening to a new client, now when the thread starts execution and during its execution the server needs to pass it an object of some X class, how's that to be done?

View 4 Replies View Related

Programming :: Passing Array To Thread Function?

Aug 12, 2010

I am trying to pass an array to thread program. Its printing the val[0] value but its not printing value at val[1]. Can somebody help me with this problem.

Code:
#include <unistd.h>
#include <stdlib.h>

[code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved