Sponsored Content
Top Forums Programming Fork thread, Assertion failed. X11. Post 302491885 by Corona688 on Friday 28th of January 2011 02:40:45 PM
Old 01-28-2011
Quote:
Originally Posted by mghis
Hi all.
I wrote a program with the Motif Widget Toolkit. It has a
button and a scrollbar. When the user hits the button the
callback creates a new fork() thread.
That's no thread. fork() creates a completely new process, with duplicates of all memory and open files therein. It doesn't even share your variables -- modify a variable in one, it won't be reflected in the other.
Quote:
The new thread sleeps for a while and then changes the position of the scrollbar. It does this in an endless loop.
Try creating an actual thread-thread. See man pthread_create.
This User Gave Thanks to Corona688 For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Endless loop - Fork function failed?

I need a quick script that will serve as a sort of "real time monitor" for watching some log files. I am using Bourne shell in HP-UX 10.20. I have basically created a script that never ends, unless of course I manually terminate it. Here's the script (it's called qhistory): clear echo "REAL... (3 Replies)
Discussion started by: cdunavent
3 Replies

2. UNIX for Advanced & Expert Users

SFTP error Assertion failed

I get this error when I try to FTP from an HP Alpha Server to a UNIX box. FATAL: BUILD13$:SSHFC_TRANSFER.C;1:1835 SshFCTransfer (function name unavailable) Assertion failed: tdata ->current_dest_file->attributes->flags & 0x00000004 the sftp /put fails just before it does the actual transfer.... (2 Replies)
Discussion started by: NoelSacay
2 Replies

3. Windows & DOS: Issues & Discussions

cygwin-x/can't install xorg-x11-f100 & xorg-x11-fnts

Hello All. Really a newbie to Linux/Unix. Trying to get into Linux. Using XP PE currently. Installed cygwin and trying to intall cygwin-x. Everything else is setup nice but i can't seem to install these two packages (without whom xwin won't start) 1. xorg-x11-f100 2. xorg-x11-fnts Tried the... (1 Reply)
Discussion started by: binodbdrchand
1 Replies

4. UNIX for Advanced & Expert Users

Use fork() in thread

Hi experts, I have a plan to implement following schema: multi-threaded pthreads application with exactly 3 threads. One thread calls from time to time fork(), and from the child process it executes an unix command by execv(). Is that safe design? I've heard rumors that mixing threads and... (3 Replies)
Discussion started by: Pavel.Bures
3 Replies

5. SCO

-sh: fork failed - too many processes in sco unix 5.0.5

Dear experts, I have done a re-installation of sco unix openserver 5.0.5 and managed to create users. The problem am facing is that of one user logging in more than 5 times. How can i overcome this problem. the system give the error below. -sh: fork failed - too many processes in sco unix... (5 Replies)
Discussion started by: njoroge
5 Replies

6. SCO

SLD: Failed to start the PMD Connection thread. (PM_THREAD_FAILED_TO_START).

Hello, I have a client with an 18 year old SCO Openserver 5.0.5 server. They can't find their installation media. They are experiencing an error at login: *LOGIN: ERROR- Failed to initialize policy manager. (IFOR_PM_FATAL) The status from the policy manager daemon (PMD -... (10 Replies)
Discussion started by: brhunt
10 Replies

7. UNIX for Advanced & Expert Users

[Solved] putty+x11:How do I pass X11 display rights to "su"?

I can log into a unix system with Putty. I've set the "X11 forwarding" checkbox, and I've verified that I can display an X11 window back on my laptop. What I need to be able to do is "su" to another uid after logging in and then run something which display a window back on my laptop, with the... (2 Replies)
Discussion started by: dkarr
2 Replies

8. AIX

Fork Function Failed on 4GB ?

Hello, I am running Oracle Database and after a while I keep getting this message whenever I execute any command. I cannot execute any command even shutdown, whenever I execute any command , I get this message /usr/bin/ksh: 0403-031 The fork function failed. There is not enough memory... (7 Replies)
Discussion started by: filosophizer
7 Replies
set_close_button_callback(3alleg4)				  Allegro manual				set_close_button_callback(3alleg4)

NAME
set_close_button_callback - Handles the user clicking on the close button of the window. Allegro game programming library. SYNOPSIS
#include <allegro.h> int set_close_button_callback(void (*proc)(void)); DESCRIPTION
On platforms that have a close button, this routine installs a callback function to handle the close event. In other words, when the user clicks the close button on your program's window or any equivalent device, the function you specify here will be called. This function should not generally attempt to exit the program or save any data itself. The function could be called at any time, and there is usually a risk of conflict with the main thread of the program. Instead, you should set a flag during this function, and test it on a regular basis in the main loop of the program. Pass NULL as the `proc' argument to this function to disable the close button functionality, which is the default state. Note that Allegro cannot intercept the close button of a DOS box in Windows. Also note that the supplied callback is also called under MacOS X when the user hits Command-Q or selects "Quit" from the application menu. Example: volatile int close_button_pressed = FALSE; void close_button_handler(void) { close_button_pressed = TRUE; } END_OF_FUNCTION(close_button_handler) ... allegro_init(); LOCK_FUNCTION(close_button_handler); set_close_button_callback(close_button_handler); ... while (!close_button_pressed) do_stuff(); RETURN VALUE
Returns zero on success and non-zero on failure (e.g. the feature is not supported by the platform). SEE ALSO
set_window_title(3alleg4) Allegro version 4.4.2 set_close_button_callback(3alleg4)
All times are GMT -4. The time now is 09:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy