Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Alt-f4 close with multiple threads  (Read 3453 times)
0 Members and 1 Guest are viewing this topic.
Offline roland
« Posted 2013-02-11 10:00:54 »

Hi, just confirming, does alt f4 completely destroy the process (and all threads)? or is there some cases where if a thread that is not the main thread is stuck in an infinite loop, the program won't close properly?

Offline RobinB

JGO Ninja

Medals: 45
Projects: 1
Exp: 3 years

Spacegame in progress

« Reply #1 - Posted 2013-02-11 10:30:03 »

If you make all threads deamon, they always close when the main thread is closed.
But when you close an process, i guess all associated threads are closed anyways.
Offline roland
« Reply #2 - Posted 2013-02-11 11:21:52 »

Thanks  Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #3 - Posted 2013-02-11 12:55:47 »

Hi, just confirming, does alt f4 completely destroy the process (and all threads)?

Alt-F4 on what?  If you mean on a JFrame for example, then not necessarily unless you explicitly set the default close operation to call System.exit() - see  Anything else, depends on what toolkit you're using.  Implicitly or explicitly calling System.exit() should destroy everything.

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline Best Username Ever

Junior Devvie

« Reply #4 - Posted 2013-02-11 23:26:42 »

Alt-f4 sends a close request message to the active window. That is handled by the operating system. The program that owns that window can ignore the message, close the window, ask the user if they really want to close something, or do something else entirely. Then the program has to clean things up behind the scenes even if the window disappears. So obviously alt-f4 cannot do anything disruptive on its own or automatically do anything.
Pages: [1]
  ignore  |  Print  

mercenarius (12 views)
2020-06-04 19:26:01

mercenarius (18 views)
2020-06-04 19:13:43

Riven (853 views)
2019-09-04 15:33:17

hadezbladez (5843 views)
2018-11-16 13:46:03

hadezbladez (2653 views)
2018-11-16 13:41:33

hadezbladez (6269 views)
2018-11-16 13:35:35

hadezbladez (1506 views)
2018-11-16 13:32:03

EgonOlsen (4742 views)
2018-06-10 19:43:48

EgonOlsen (5801 views)
2018-06-10 19:43:44

EgonOlsen (3292 views)
2018-06-10 19:43:20
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!