Create account / Log in

AWT EventQueue

Discussion area for the development team.

Moderators: uckelman, Tim M

AWT EventQueue

Postby Flint1b » July 26th, 2020, 1:13 am

Is there a reason why the whole Player.launch() runs in the AWT EventQueue thread, including opening the zip file, loading and building the module, etc? I'm no front end developer but shouldn't the EventQueue be only used to GUI-related tasks?
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: AWT EventQueue

Postby Flint1b » July 26th, 2020, 1:28 am

And it keeps getting better, you let the main application thread DIE right after it starts and before the first pixel is drawn on the screen?! Does the whole application and not just Player.launch() run in the AWT Thread then??

Oh you....

And then complain about how bad Java is, how slow the game loads, and worry about how performant tiny parts of unprofiled code work..

So what is the plan to make things right and stop misusing the GUI thread for non-GUI work?
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: AWT EventQueue

Postby uckelman » July 26th, 2020, 2:28 pm

Thus spake Flint1b:
> Is there a reason why the whole Player.launch() runs in the AWT
> EventQueue thread, including opening the zip file, loading and building
> the module, etc? I'm no front end developer but shouldn't the EventQueue
> be only used to GUI-related tasks?

Second line of Player.launch():

GameModule.init(createModule(createDataArchive()));

That can't run off the EDT, due to the fact that basically everything
in GameModule has to run on the EDT. I didn't decide to make it this way;
GameModule was already that way when I got here. Model-view separation is
extremly hard to retrofit into a design which didn't have it fromt the
start. We've discussed doing it several times before; my view is that it
will be less work to do it correctly from the beginning in V4 than to
refactor everything to do it here.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 9014
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: AWT EventQueue

Postby uckelman » July 26th, 2020, 2:40 pm

Thus spake Flint1b:
> And it keeps getting better, you let the main application thread DIE
> right after it starts and before the first pixel is drawn on the
> screen?! Does the whole application and not just Player.launch() run in
> the AWT Thread then??

Yep. There's no other way, short of refactoring very nearly everything.

> Oh you....
>
> And then complain about how bad Java is, how slow the game loads, and
> worry about how performant tiny parts of unprofiled code work..

I stand behind all of my complaints. If you have specific ones you'd
like to discuss, please be specific.

> So what is the plan to make things right and stop misusing the GUI
> thread for non-GUI work?

V4 is the plan for that.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 9014
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest