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 #18956 is a reply to message #18955] Sun, 02 November 2008 16:34 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
mdelfede wrote on Sun, 02 November 2008 09:52

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




Ehm, now this one is correct and I am wrong.

In fact, theide itself forks in SlaveProcess quite frequently.

Mirek
 
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: Sun Jun 29 20:39:18 CEST 2025

Total time taken to generate the page: 0.03846 seconds