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 » U++ Library support » U++ Library : Other (not classified elsewhere) » fork() problem
Re: fork() problem [message #18955 is a reply to message #18951] Sun, 02 November 2008 15:52 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
luzr wrote on Sun, 02 November 2008 15:07

mdelfede wrote on Sat, 01 November 2008 15:29

This (very simple) gui app :

GUI_APP_MAIN
{	

	int pid;
	pid = fork();
	if(pid > 0)
	{
		PromptOK("Process " + AsString(pid));
		return;

	}
	else if (pid == 0)
	{
		PromptOK("Parent Process");
		return;
	}
	else
	{
		PromptOK("ERROR");
		return;
	}

	TestFork().Run();
}


Crashes (with memory leak msgbox) instead of forking into 2 processes.

Max




Eh, I wish I knew all details that can go bad when forking GUI process. Anyway, for starters, there is socket open to communicate with X11 server - wonder what happens to that Smile

Mirek


Well, I would have been happy to fork and close the parent (that was what I needed...) but doesn't work either.
I guess the fork() must be done BEFORE the gui initialization.

The strange stuff is that SysExec() package USES the fork() and it works....

Max

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SelfUpdate()
Next Topic: Huge font in upp[Gnome-Debian]
Goto Forum:
  


Current Time: Sat Jun 08 02:14:33 CEST 2024

Total time taken to generate the page: 0.01618 seconds