----- Original Message ----- From: "Michael Phipps" <mphipps1@xxxxxxxxxxxxxxxx> To: <openbeos@xxxxxxxxxxxxx> Sent: Tuesday, April 02, 2002 8:02 PM Subject: [openbeos] Re: Kernel/app_server req #768 - suspend/resume > This is an R2 thing. > > But I will talk a little bit, here, about the technical side of it... > > Unix apps, as many of you know, can be sent a SIGSTOP (iirc). > The app stops and is not scheduled, much as Zenja suggests, here. Pedantic note: BeOS kernel sends a SIGSTOP to a thread as result of a suspend_thread(tid); as it sends a SIGCONT as a result of a resume_thread(tid). You probably are confusing SIGSTOP with the usual Ctrl-Z bussines. That it is not SIGSTOP but SIGTSTP. The latter requires all the session and job control stuff that it is not implemented in the BeOS tty layer. > >From what I understand, and if someone knows differently, please say so, > signals under R5 are on a per-thread basis. And that makes sense, given that > really, in the kernel, the threads of a process are a lot less bound together than > in a traditional Unix style threaded environment. Signals, sig handlers, sig masks and (of course) pending signals, are on a per-thread basis. However kill(-pid, ...) will send a signal to all threads in process pid if i remember correctly. Note also that some of the signal stuff it is fixed in Dano (for instance SIGWINCH was not properly handled, that was the reason why some version of ssh died when you resized the window). > Also, you would have to decide what to do with allocated resources. If the app opens a window, > it could easily get confusing, since the app_server side controls would still function, but the messages > to the application would stack up... In general it is a bad idea to stop applications threads indiscriminately. Also note that there is a lot of application code on the net that does not check the return code of things like acquire_semaphore(). manuel,