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.

Problem with perform in thread

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


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.
           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
           cancel "s$balanza".
       Lectura_Scanner section.

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?

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.