Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Sound in linux (Lack of standards in Linux is a problem but there are some near-standards)
Re: Sound in linux [message #44071 is a reply to message #44067] Mon, 22 December 2014 09:56 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

rainbowsally wrote on Mon, 22 December 2014 08:01
But let's say you launch a shell with a command to.. let's say 'find' everything on your C drive and dump it into a text file.

Anything, just something that takes a long time would do.

If this shell is launched by way of a stystem() call from a GUI, will the GUI hang until 'find' is done?

From the man page of system():
Quote:

The system() library function uses fork(2) to create a child process
that executes the shell command specified in command using execl(3) as
follows:

execl("/bin/sh", "sh", "-c", command, (char *) 0);

system() returns after the command has been completed.

So to answer your question, yes it blocks. But you can always call fork() and one of the exec* functions (there is about six of them). That in itself is not blocking, later you can check if the process is completed by calling waitpid(pid_returned_from_fork, &return_code, NOHANG), which is also nonblocking operation.

Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Raster::Line segfaults ... sometimes.
Next Topic: Adding network proxy support to U++
Goto Forum:
  


Current Time: Sat May 11 13:59:43 CEST 2024

Total time taken to generate the page: 0.01930 seconds