Author Topic: EA behavior for multi-threaded environment  (Read 3368 times)

ea0921

  • EA User
  • **
  • Posts: 96
  • Karma: +0/-1
    • View Profile
EA behavior for multi-threaded environment
« on: September 23, 2024, 11:10:33 pm »
Hello,

I have created a multi-threaded application that communicates with EA system. Set-up for my application is as follows:

There are 5 threads: T1 to T5 which parallelly make request to EA system using API.

Out of all the above 5 threads, suppose request of third thread T3 is wrong request which results into pop-up to be displayed from EA application.
Because of pop-up, my EA application stops its processing for other threads request and all the remaining thread gets halted until the pop-up is not closed.

I want to perform following operation:
1. Fetch the text from pop-up and close the pop-up from the program.(Done)
2. Pass the pop-up to the thread which caused the pop-up. In my case third thread (T3)

I want to know about the following:
1. Is my understanding of EA stops processing further request until pop-up is not closed correct? I want the actual behavior of EA in multi-threaded environment.
2. Is there any way to identify which thread cause the pop-up to occur so that I can get to know which thread caused the issue?

Thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA behavior for multi-threaded environment
« Reply #1 on: September 23, 2024, 11:25:52 pm »
EA is a single user front-end. So yes, it will be idle on a pop-up. Getting that is at least tricky, if possible at all. You might find backdoors in Windoze. But other than that EA will keep you in the dark.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13274
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA behavior for multi-threaded environment
« Reply #2 on: September 24, 2024, 03:35:08 am »
I don't know the answer to your question, but I think your problem is trying to do stuff in parallel with EA.

Have you considered starting up different EA application that each deal with their thread?
Then you won't need to figure out which thread causing the blockage.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8063
  • Karma: +118/-20
    • View Profile
Re: EA behavior for multi-threaded environment
« Reply #3 on: September 24, 2024, 08:41:39 am »
There are 5 threads: T1 to T5 which parallelly make request to EA system using API.
That won't work. The Enterprise Architect API is a single-thread apartment.

ea0522

  • EA User
  • **
  • Posts: 134
  • Karma: +5/-0
    • View Profile
Re: EA behavior for multi-threaded environment
« Reply #4 on: September 24, 2024, 04:32:33 pm »
Why do a pop-up at the first place?
If it is a result of an error, you probably could try to catch that error.
If it is necessary to have the pop-up for user interaction, then there should be no need to close it automatically.
If the API creates the pop-up, you probably should look for another API call which doesn't generate a pop-up.
HTH

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13274
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA behavior for multi-threaded environment
« Reply #5 on: September 24, 2024, 05:54:52 pm »
Why do a pop-up at the first place?
If it is a result of an error, you probably could try to catch that error.
If it is necessary to have the pop-up for user interaction, then there should be no need to close it automatically.
If the API creates the pop-up, you probably should look for another API call which doesn't generate a pop-up.
HTH
You are fighting windmills. EA (and its API) is what it is.
You can report bugs, and suggest features, but don't expect it to change quickly to what you need.

Instead just find a way to work with and around it.

In this specific case

1. Don't use multithreaded parallel processing on an API that is basically designed for single threads
2. Make sure to prevent all errors that could cause popups (or other nasty behavior)

Geert

PS. To be honest, I do sometimes use multithreading (background workers) in my add-ins to not block the GUI while getting information. It's not ideal, and has caused me some headaches in the past, but it mostly works now (and where it doesn't, I catch and bury the exceptions).