Skip to content

thread starvation #139

Closed
Closed
@Tieske

Description

This code:

copas/src/copas.lua

Lines 595 to 602 in 4d3a7e7

if (math.random(100) > 90) then
current_log[client] = gettime() -- TODO: how to handle this??
if current_log == _writing_log then
coroutine_yield(client, _writing)
else
coroutine_yield(client, _reading)
end
end

is intended to yield to prevent starvation. It should be replace by a simple copas.sleep() to achieve the same thing, but simpler. Also raises the question on starvation when reading data. Should read have a similar check?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions