Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
CIAC Absent Member.
Absent Member.
905 views

Problem with perform in thread

[Migrated content. Thread originally posted on 28 September 2011]

Hello,

I'm getting freeze problems in my program when i do:

perform in thread Lectura_Scanner handle in scanner-thread
until scanner-activo-no

       Lectura_Scanner section.
       Lectura_Scanner_1.           
           initialize sca-envio-scanner.
           call "s$balanza" using by content sca-puerto
                                  by content sca-envio-scanner
                                  by content sca-velocidad
                                  by content sca-paridad
                                  by content sca-bits-datos
                                  by content sca-bits-parada
                                  by reference sca-lectura
           on exception
              move "s$balanza" to calling-program
              perform errcall
           not on exception
              continue
           end-call.
           cancel "s$balanza".
       Lectura_Scanner_99.
       Lectura_Scanner section.
       Lectura_Scanner_100.           
          exit.


The problem happens when the subthread do the call "s$balanza", the main thread gets totally freeze until the call ends. Inside "s$balanza" there is some calls to windows api to scan a COM port and the program can wait to get response from the com port and for that i put "s$balanza" in a thread.

I'm a bit lost because normally a subthread must not stop the process of the mainthread... is the reason to use different threads.

¿Any tips?

Thanks!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.