ProcessorScheduler.st
changeset 1641 4adf4b8dad17
parent 1627 f95285226059
child 1676 12b3b5dcf68f
equal deleted inserted replaced
1640:db4aef0f601b 1641:4adf4b8dad17
  1921      an #EBADF error, leading to high-frequency polling and a locked up system.
  1921      an #EBADF error, leading to high-frequency polling and a locked up system.
  1922      (you could still fix things by interrupting on the console and fixing the
  1922      (you could still fix things by interrupting on the console and fixing the
  1923       readFdArray/writeFdArray in the debugger)"
  1923       readFdArray/writeFdArray in the debugger)"
  1924 
  1924 
  1925     readFdArray keysAndValuesDo:[:idx :fd |
  1925     readFdArray keysAndValuesDo:[:idx :fd |
  1926         |rslt|
  1926         |rslt sema|
  1927 
  1927 
  1928         rslt := OperatingSystem
  1928         rslt := OperatingSystem
  1929                     selectOnAnyReadable:(Array with:fd)
  1929                     selectOnAnyReadable:(Array with:fd)
  1930                                writable:nil
  1930                                writable:nil
  1931                               exception:nil
  1931                               exception:nil
  1932                             withTimeOut:0.
  1932                             withTimeOut:0.
  1933 
  1933 
  1934         (rslt isNil and:[OperatingSystem lastErrorSymbol == #EBADF]) ifTrue:[
  1934         (rslt isNil and:[OperatingSystem lastErrorSymbol == #EBADF]) ifTrue:[
  1935             ('PROCESSOR: removing invalid read fileDescriptor: ' , fd printString) errorPrintNL.
  1935             ('PROCESSOR: removing invalid read fileDescriptor: ' , fd printString) errorPrintNL.
  1936             readFdArray at:idx put:nil.
  1936             readFdArray at:idx put:nil.
  1937             OperatingSystem clearLastErrorNumber
  1937             OperatingSystem clearLastErrorNumber.
       
  1938             (sema := readSemaphoreArray at:idx) notNil ifTrue:[
       
  1939                 readSemaphoreArray at:idx put:nil.
       
  1940                 sema signal.
       
  1941             ].
  1938         ]
  1942         ]
  1939     ].
  1943     ].
  1940 
  1944 
  1941     writeFdArray keysAndValuesDo:[:idx :fd |
  1945     writeFdArray keysAndValuesDo:[:idx :fd |
  1942         |rslt|
  1946         |rslt sema|
  1943 
  1947 
  1944         rslt := OperatingSystem
  1948         rslt := OperatingSystem
  1945                     selectOnAnyReadable:nil
  1949                     selectOnAnyReadable:nil
  1946                                writable:(Array with:fd)
  1950                                writable:(Array with:fd)
  1947                               exception:nil
  1951                               exception:nil
  1948                             withTimeOut:0.
  1952                             withTimeOut:0.
  1949 
  1953 
  1950         (rslt isNil and:[OperatingSystem lastErrorSymbol == #EBADF]) ifTrue:[
  1954         (rslt isNil and:[OperatingSystem lastErrorSymbol == #EBADF]) ifTrue:[
  1951             ('PROCESSOR: removing invalid write fileDescriptor: ' , fd printString) errorPrintNL.
  1955             ('PROCESSOR: removing invalid write fileDescriptor: ' , fd printString) errorPrintNL.
  1952             writeFdArray at:idx put:nil.
  1956             writeFdArray at:idx put:nil.
  1953             OperatingSystem clearLastErrorNumber
  1957             OperatingSystem clearLastErrorNumber.
       
  1958             (sema := writeSemaphoreArray at:idx) notNil ifTrue:[
       
  1959                 writeSemaphoreArray at:idx put:nil.
       
  1960                 sema signal.
       
  1961             ].
  1954         ]
  1962         ]
  1955     ].
  1963     ].
  1956 
  1964 
  1957     "Modified: 12.4.1996 / 09:32:58 / stefan"
  1965     "Modified: 12.4.1996 / 09:32:58 / stefan"
  1958     "Modified: 24.7.1996 / 16:55:47 / cg"
  1966     "Modified: 29.8.1996 / 22:42:28 / cg"
  1959 !
  1967 !
  1960 
  1968 
  1961 schedulerInterrupt
  1969 schedulerInterrupt
  1962     "forced reschedule - switch to scheduler process which will decide
  1970     "forced reschedule - switch to scheduler process which will decide
  1963      what to do now."
  1971      what to do now."
  2094 ! !
  2102 ! !
  2095 
  2103 
  2096 !ProcessorScheduler  class methodsFor:'documentation'!
  2104 !ProcessorScheduler  class methodsFor:'documentation'!
  2097 
  2105 
  2098 version
  2106 version
  2099     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.88 1996-08-14 13:47:47 cg Exp $'
  2107     ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.89 1996-08-29 20:52:10 cg Exp $'
  2100 ! !
  2108 ! !
  2101 ProcessorScheduler initialize!
  2109 ProcessorScheduler initialize!