Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > C Unix calling system() from multithreaded process

Reply
Thread Tools

C Unix calling system() from multithreaded process

 
 
talisman
Guest
Posts: n/a
 
      11-24-2004
hi,

one of my friends was saying it's not a good idea to do this.

certainly on my Solaris box man system makes a similar statement.

could anyone elaborate in practicality how risky this is?

i'm currently calling the system() function from within my 64 bit c
app..

i've had to do this because my program has to work with code for which
there are only 32bit libraries - hence my system() call to the
external 32 bit command.

is there a better way of doing this?
 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      11-24-2004
On 23 Nov 2004 19:25:34 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) (talisman)
wrote in comp.lang.c:

> hi,
>
> one of my friends was saying it's not a good idea to do this.


To do what? Some newsreaders do not display the subject line when
displaying the message bodies. Always include your topic in the body
as well.

In any case, the C language does not support threads or processes, so
there is no language issue involved here.

> certainly on my Solaris box man system makes a similar statement.


If your compiler documentation suggests that you should not do this,
then you probably shouldn't. If you want to know why, contact Sun
technical support or ask in a Solaris programming group. I seem to
remember that there is one.

> could anyone elaborate in practicality how risky this is?


Not anyone here, no, it is off-topic.

> i'm currently calling the system() function from within my 64 bit c
> app..
>
> i've had to do this because my program has to work with code for which
> there are only 32bit libraries - hence my system() call to the
> external 32 bit command.


There is no such thing as "64 bit C" or "32 bit libraries" in the C
language. These are implementation details of your compiler and
platform, not anything to do with the language.

> is there a better way of doing this?


Yes, consulting the sources I suggested above.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl process as a unix background process gbostock@excite.com Perl Misc 14 08-15-2009 02:41 PM
multithreaded calling of static func clqrq@yahoo.de C++ 3 09-28-2006 02:11 PM
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C Programming 18 01-10-2005 03:35 AM
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C++ 12 01-10-2005 03:35 AM
my own perl "dos->unix"/"unix->dos" Robert Wallace Perl Misc 7 01-22-2004 10:59 PM



Advertisments