Skip to content

Redefinition of operations on method for sequential extraction #2

@648trindade

Description

@648trindade

Some atomic read/writes can be avoided since chunk_end has the same value of first during all the scheduling

function EXTRACT_SEQ
  old_first <- first
  chunk_begin <- MIN(chunk_end + chunk_size, last)
  if chunk_begin > chunk_end then
    first <- chunk_begin
    if chunk_begin < last then ! Confirma se a extração é válida
      tmp <- chunk_end
      chunk_end <- chunk_first
      chunk_first <- tmp
      return TRUE
    end if
    first <- chunk_end ! Conflito: desfaz e trava a si próprio
  end if
  LOCK(self)
  chunk_begin <- first
  if chunk_begin < last then
    first <- chunk_end <- last
  end if
  UNLOCK(self)
  return chunk_begin < first
end function

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions