How do the different types of exec work? Do the parent and child threads need to be compiled separately?
How do the different types of exec work? Do the parent and child threads need to be compiled separately?
?? not sure what you mean by that. What are you trying to do?
there are many varieties of exec_ function, each does something a bit differently. man exec for all the options or look here: http://linux.about.com/library/cmd/blcmdl3_execvp.htm
some entropy with that sink? entropysink.com
there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka
fork() .. exec..() calls create child processes running separate code streams. Threads are different from processes.
try man pthread
>>Threads are different from processes.<<
hehe, then why do they appear in 'ps' As I'm getting more into OS design, I've noticed that thread implementation in Linux has many shortcomings - with many issues still not being addressed in the newest kernels.
some entropy with that sink? entropysink.com
there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka
Just curious what shortcomings are you refering to.
Are you speaking of posix threads.
what I was needing to do was have a parent process that created n child processes. the parent sends data to the child by a pipe represented by a int in[n][2]. and each child will output to a single pipe sending data back to the parent. I have no idea how to implement this, I have looked all over, and I can't find anything that works for this. please help me out if you can.
>>Just curious what shortcomings are you refering to.
Are you speaking of posix threads.<<
No, I'm talking about threads in general. If you look at the documentations of Kernels as they are "improved " over time, threads are the one thing that always need more and more improvement. When 2.6 came out, the documentation stated "Improved simultenous multithreading; better performance on CPus with hyperthreading support". Other issues I've read about: threads acting/appearing as processes, poor implementation of the three main kinds of threads, etc etc.
I had a good link about it all but can't find it now maybe its on my school account
some entropy with that sink? entropysink.com
there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka
Can anyone help me?
Do you have anything to work from? anything you tried? show some code.
This shouldn't be that difficult since you could use an array of pipes.
some entropy with that sink? entropysink.com
there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka
Axon - Linux threads aren't really POSIX compliant - I don't know for sure but I think some newer versions of some distros have it right.
Early Linux used processes that pretended they were threads. A process is a container for threads.
Actually, gnu's new libc incorporates native posix thread library (NPTL) which is a lot better than in previous linuxs. Look here for more infor http://people.redhat.com/drepper/nptl-design.pdf
LInux is getting better with threads, but I agree they need work.
Help populate a c/c++ help irc channel
server: irc://irc.efnet.net
channel: #c
Korn1699, correct me if I'm wrong, but you want to create n child processes that communicate (IPC) via pipes.
You can do this using fork and using dup2 function to copy file descriptors (pipe ends) between paraent and child. Then use these file descriptors to communicate between the two.
There's plently on IPC using this methods on the Net - try google:
http://www.google.co.uk/search?hl=en...fork+ipc&meta=
rotis23