Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Subscription Multithreading issue?
January 19, 2017
12:24, EET
Avatar
kapsl
Member
Members
Forum Posts: 57
Member Since:
December 20, 2016
sp_UserOfflineSmall Offline

Hello together,
at the moment we have following strange behaviour:
We have a subscription on a value: Normally this works perfect, and we get updates about the value.

Now we are calling a method on another connection (UaClient) and this method execution takes quite a while (ca. 20sec). While this method is blocking the main thread no new subscriptions values are received.

When we made the method call in a new thread, we got the subscription values.

Doesn’t the prosys stack add a new thread, when adding a subscription and running this independently from the main thread?

lg Manu

January 19, 2017
15:13, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello,

The SDK and Stack use a thread pool for different service calls, so the operation that you described should not happen. This means that the subscription in your application should be working normally regardless of another long running service call made simultaneously.

Just out of curiosity: what platform are you using?

January 19, 2017
15:43, EET
Avatar
kapsl
Member
Members
Forum Posts: 57
Member Since:
December 20, 2016
sp_UserOfflineSmall Offline

It’s just a normal laptop with Windows…

January 19, 2017
16:07, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Thank you for the information.

We’re happy to take a look if you have some code example about how to reproduce this. If possible, prepare the code example with SampleConsoleClient/-Server applications in the Java SDK. Otherwise it’s hard to say what’s going wrong because I’m not able to reproduce the same issue myself and in principle this shouldn’t happen.

January 20, 2017
12:16, EET
Avatar
kapsl
Member
Members
Forum Posts: 57
Member Since:
December 20, 2016
sp_UserOfflineSmall Offline

Hi,
indeed it’s difficult to provide a code examples, because there is quite a lot of code behind. Using an extra thread solved the problem, also it is not the ideal solution. And for future use we anyway plan to call the method let it return quickly and then send an event if a longer running task is finished.

Just because I’m curious is there anything implemented for this “programs” (as longer tasks) in the prosys stack, yet? I have not found a single example or something….

Thanks,
lg Manu

January 26, 2017
16:49, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi Manu,

Unfortunately, there’s no examples about the Programs specification in the Java SDK currently. That being said, there’s also no known issues prohibiting you from developing applications according to the Programs specification.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1