Ubuntu :: When Does The POSIX Thread Start

Feb 3, 2010

i'm trying to understand the POSIX threads and i can't understand when does the thread start: does it start when i do

pthread_create()
or when i do
pthread_join()

or maybe i'm missing something. i do understand that pthread_join() causes the calling thread to wait till the called thread is finished.

View 2 Replies


ADVERTISEMENT

Software :: Posix Semaphores Posting For More Than One Thread At A Time?

Apr 12, 2011

I would like to know can we post more than one thread at a time.I have code like below

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

[code]...

View 2 Replies View Related

Ubuntu :: Can't Start New Thread In Community Cafe

Feb 1, 2011

I can't start a new thread in the community cafe because there is no 'new thread' button to be clicked.

View 2 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

Networking :: Remote Host SSH Response: Tcl_InitNotifier: Unable To Start Notifier Thread

Oct 12, 2010

My SSH client for remote machine will sometimes hang. I have to wait until the session is finished hanging, I guess, to login with SSH again. I would get some message about multiple users or something.

I haven't been able to login this time for over 1 day. It's started saying something about Tcl_InitNotifier: unable to start notifier thread. My host can access the machine locally to fix this, but what is going on? Why is this occurring?

Here is the login attempt:

Code:

View 1 Replies View Related

Ubuntu :: How To Enable POSIX Shared Mem

Jan 29, 2010

I found out from here that it is not enable URL...I ran the command mount | grep "shm" and got.none on /dev/shm type tmpfs (rw,nosuid,nodev)So how do I enable it?It is need for my ATI graphic card.

View 2 Replies View Related

Debian :: Posix Related During Compilation?

Sep 4, 2011

I am trying to compile splasutis in my debian wheezy. ./configure run well, but during make I get the following error

make --silent all-recursive
Making all in libs
CONF    libjpeg.a

[code]....

View 7 Replies View Related

General :: Support For POSIX Trace?

Oct 14, 2010

Is it possible to add support for POSIX Trace to my Ubuntu?

# getconf _POSIX_VERSION
200809
# getconf _POSIX_TRACE
undefined

View 2 Replies View Related

General :: Set Distro To Be A POSIX Compliant?

Oct 2, 2010

How to set you distro to be a POSIX compliant?

View 3 Replies View Related

Server :: Use Phpldapadmin Can Add Ou,but Cannot Add Posix Group?

Mar 27, 2010

use phpldapadmin can add ou,but can not add posix group.following is software version

[root@localhost config]# rpm -qa | egrep '(ldap|db4)'
openldap-devel-2.3.27-8.el5_1.3
db4-utils-4.3.29-9.fc6

[code]....

View 1 Replies View Related

Programming :: Synchronize 2 Posix Threads ?

Mar 15, 2011

I have 2 threads and both of them are deleting memory at the end nedded by both.

My problem is that maybe it can happen that a thread start and finish before the other one starts and so it deletes the memory nedded by the other thread. How can I synchronize them so that this can't happend.

As a design my threads look like this:

Code:

The other thread looks the same, but this isn't unoff to stop thread1 to finish before thread2 starts.

View 4 Replies View Related

Security :: SetUID: Limit The Use With POSIX Capabilities?

Nov 15, 2010

It is known that binaries with the SetUID bit enabled are a threat for the system.I saw on this ArchLinux wiki[URL].tead_Of_Setuida way to limit the use of SetUID bit thanks to POSIX capabilities.It looks very interesting.Does anyone of you used it already?Is it a burden for the system afterwards (like binaries not working, needing to be fixed); or is it seamless

View 3 Replies View Related

Programming :: Proper Implementation Of POSIX Threads

Apr 6, 2011

I've implemented a program URL... which reads digital IF data from a radio receiver through a named pipe, measures power levels, and sends the result to stdout. The program is interactive; there is a thread that reads from stdin to watch for commands, a thread that constantly either reads data from the named pipe or throws data away, and an array of processing threads. The program uses GTK+extra to plot the signals. The IF data stream bandwidth exists at the limits of today's technology (is very very fast).

Problem Statement:The program works fine with a few bugs. I've learned since I've made it that using global state variables to coordinate threads isn't a good way of doing it. I also only had knowledge of mutexes and polled the state variable instead of using other methods.My reimplementation will use the following:

- One "Stdin Command Monitoring" thread
- One "Get data from named pipe" thread
- One post-processor thread
- N Processing threads

All threads are alive during the life of main()There are N buffers. Data will come in from the named pipe, and the "Get data" thread will write the data to an "available" buffer. When the buffer is full it will be marked as "full". There will be N processing threads, one for each buffer. When a processing threads' buffer is full, it will process the buffer and save the result to a final buffer. At the end of a number of averages, the post-processor thread will perform a final process on the final buffer and send the results to stdout.

View 2 Replies View Related

Debian :: Permanently Change Locale From POSIX To En_GB?

Apr 3, 2010

All my LC environment variables are currently set to POSIX at boot, though I can't find the startup script that does this. I've grepped through /etc/rcS.d and /etc/rc2.d but no luck. In /etc/default/locale, LANG is set to en_GB.UTF-8, which is my preferred locale. But this doesn't stop all the LC's being set to POSIX. Consequently, my dates follow the American convention, which I find hard to read.

I tried resetting with update-locale LC_TIME=en_GB.UTF-8. This changed all the locales to en_GB but only for the session. When I rebooted, everything went back to POSIX. The only change is that en_GB.utf-8 is now in the /etc/default/locale file as the value of LC_TIME as well as LANG.

View 2 Replies View Related

Programming :: Closing / Unlinking POSIX Message Queues?

Apr 15, 2011

I have a pthread waiting forever on a POSIX message queue and then call mq_close and mq_unlink on the POSIX message queue. I've found that the pthread never wakes up from it's call to mq_receive and remains blocked indefinitely. Is there a way to wakeup all pthreads blocked on a POSIX message queue after calling mq_close/mq_unlink? The goal is to include error handling during message queue deletion to avoid leaving any pthreads blocked forever.

View 2 Replies View Related

Server :: Multiple Users Per Ldsp Posix Group?

Mar 15, 2010

I want to add some users to multiple groups. syntax of the file to pass to ldapadd? or would I use lapmodify? Does one add/modify a user record to specify the groups that user is a member of? Or does one add/modify each group record to specify which users are members?

View 1 Replies View Related

Programming :: Find Number Of Child Processes (C / POSIX)?

May 26, 2010

I'm in the process of writing a program that is a server- it will accept connections and stuff, and spawn a child process for each. However, i've run into a small problem. I do NOT want to bother with keeping track of the processes unless i need to. So, i set SA_NOCLDWAIT (#ifdef) on a SIG_IGN to the SIGCHLD handler through sigaction interface. The standard says that it the kernel will then keep track of reaping zombie processes for me (a HUGE plus). However, upon receiving a SIGINT signal, i want to stop the server from accepting new connections (done), and then wait for there to be no new connections. I was thinking of just putting a loop like so:

Code:

while((wait(NULL) != (pid_t)-1) && errno != ECHILD);

However, I'm not *sure* that this will work, especially with SIGCHLD still ignored. So how can i tell if there are still child processes? I can't find any call like int getnumchld(pid_t proc); (i wish). Plus it would be inefficient to spin on that function anyway. OTOH, i would rather *NOT* have to do the same thing in a loop with a system("ps |...>file"); read(file); etc. either. Is there a way i can portably implement this feature (I was hoping i could run it on linux and the major BSDs, at least).

TO SUM IT UP:

How can i tell if a process has no child processes if i've SIG_IGN'd SA_NOCLDWAIT'd the SIGCHLD? Is there a _reasonably_ portable way to do so? I *don't* want to manually wait for EVERY process. Maybe only those still active at the time of SIGTERM, but that requires keeping track of the number of connections and whether those have terminated...

EDIT: Does anyone know if the above code *would* work, even with SIGCHLD ignored and the kernel cleaning up zombies *for* me? I checked the manpage and it doesn't say much.

EDIT1: Note that all of the processes are in the same process group and session. SO i can find them through this as well. Perhaps even setting the uid/gid and finding all processes run by that group?

EDIT2: i have an idea if the above isn't feasible. If there is no "elegant" way to do it, i could reduce the complexity by sending a SIGUSR1 to the whole process group. Each process would then set a flag telling it to send a SIGUSR1 in reply and send a SIGUSR2 when it is done executing. Then i could keep a count of signals. Maybe that would be *easier*. Or perhaps a count of all child processes and just a termination signal to decrement the counter.

View 2 Replies View Related

Programming :: Posix Message Queues - Communicate Between Two Threads?

Jan 3, 2011

I want to communicate between two threads, each belonging to a different process. Iam using message queues for this. I use mq_open()call. I created the queues with the same queue name starting with a '/'. But when I open the queue, the queue ID is different in both the process. What should I do so that both the process have the same queue ID?

View 1 Replies View Related

Programming :: Related To Pthreads And Timers In POSIX Standard

Feb 17, 2010

I have created two threads:
Thread 1 and thread 2

In the main thread, i have put up a timer which generates a signal periodically when it expires, which reults in execution going to signal catcher function.when this function is invoked, under certain condition it goes to thread 1 and under another condition it goes to thread 2. The problem lies here that when it goes to thread2,i have a loop to process but it doesnt come out of the loop and hence from thread2, even though timer has expired.

View 2 Replies View Related

Programming :: Program Hang Stuck There Signal Handling On POSIX Message Queue UNIX C Pr

Jun 14, 2011

In a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario:

View 1 Replies View Related

Ubuntu :: Test - How To Delete Thread

Jan 6, 2011

Just a test, how to delete the thread...

View 3 Replies View Related

Ubuntu Installation :: Looking For A Grub2 Thread?

Feb 10, 2011

i know i should look more through the forum, but i've been stuck on installing ubuntu on my computer for 3 days now, reinstalling, manual grub installing and so on, but no go. but i found a good thread on my still no fully functional ubuntu computer that explained very well for a complete linux noob how to install grub2 on ubuntu via the livecd. but since i was booting from the live cd meant that i couldn't bookmark it, and very little on this forum, as far as i can see, gets sticky, makes it very hard to find.

the basic problem is, i completly reinstalled ubuntu 10.10, and the bootloader (that i now know is named grub2) could not be installed. so i've found several guides, including the wiki, but it haven't really worked. now instead of explaining all of this over again, like all of you have probably done a million times, can you just post the most informative links here, so i can pick and choose,

View 9 Replies View Related

Ubuntu :: Marking A Thread As Solved?

Apr 21, 2011

I have a few Threads that have been solved but I do not know how to add that Prefix. How do I change that on an existing thread.

View 3 Replies View Related

Ubuntu :: Mark My Thread As Solved?

May 25, 2011

My problem has been solved in another thread but I cannot figure out how to mark it as solved.
How do I do this?

View 3 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

Ubuntu Servers :: How To Decrease Thread Stack Size

Feb 5, 2010

Desperate to reduce RAM usage of my tiny VPS running Ubuntu 9.04 and Apache2.2.11, here I saw that:
On Linux, each child process will use 8MB of memory by default. This is probably unnecessary. You can decrease the overall memory used by Apache by setting ThreadStackSize used by Apache by setting ThreadStackSize to 1MB in.

So I tried to give the suggestion a try. But when I append:
ThreadStackSize 1000000
in my /etc/apache2/httpd.conf <IfModule mpm_prefork_module> directive, and restarted apache, it failed with this message:
Invalid command 'ThreadStackSize', perhaps misspelled or defined by a module not included in the server configuration

So I figured out that the relevant modules are neither enabled nor available on apache2. Now I am wondering whether there is a way to decrease the ThreadStackSize without the need to compile apache from source? If not, what should I do?

View 1 Replies View Related

Ubuntu Installation :: Install Tcl With Non-thread Enabled For Some Other Software

Sep 4, 2010

I have an ubuntu 10.04 system. I have been trying to install tcl with non-thread enabled for some other software. If I install tcl from synatptic or use activetcl, then it gets installed with thread enabled option.

So I thought that I have to compile tcl from source. So i downloaded tcl8.5.8-src.tar.gz file of tcl and extracted it in a folder.I then entered the /unix folder and i ran ./configure --disable-threads and got this output:

I then did sudo make and got:

make: *** No rule to make target `/../unix/Makefile.in', needed by `Makefile'. Stop.

View 1 Replies View Related

Ubuntu Installation :: Lucid Java Woes - How To Move Thread

May 4, 2010

how to move the thread [URL]...

View 9 Replies View Related

Ubuntu Security :: New Vulnerabilities In Adobe Flash Became A Thread For Users?

Oct 30, 2010

1. May new vulnerabilities in Adobe flash became a thread for linux users? [URL]
2. By the way I would like to know if computer with linux can became a member or botnet somehow?

View 2 Replies View Related







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