Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 10 years ago

Closed 10 years ago

#88 closed defect (fixed)

cons_get_event() should be rewritten using e.g. condition variables

Reported by: Jakub Jermář Owned by: Jakub Jermář
Priority: major Milestone: 0.4.1
Component: helenos/srv/console Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

In cons_get_event() we are introducing another level of asynchronous processing in the form of the pending fibril. With the fibril synchronization primitives, this should not be necessary and e.g. a mere condition variable should do.

Change History (5)

comment:1 Changed 10 years ago by Martin Decky

I don't understand the phrase "another level of asynchronous processing". The pending operation pattern is a common way how to deal with deferred operations.

However, it is true that the console server should be rewritten once again to make use of the new async framework possibilities.

comment:2 in reply to:  1 Changed 10 years ago by Jakub Jermář

What I meant is that you have the async framework, fibrils and fibril synchronization primitives on one side and the pending mechanism on the other. Given sufficient number of fibrils, it should be possible to block the connection fibril directly until the resource is ready instead of enqueuing the request for the pending fibril. I realize that if there is only one fibril handling the devfs→console connection, then there is a problem with this suggestion.

comment:3 Changed 10 years ago by Jakub Jermář

Owner: set to Jakub Jermář
Status: newassigned

Ok, DEVFS opens a separate connection to console for each /dev/vc*. This allows to block the connection fibril which needs to wait for input. I have the fix in my workspace and will commit it later today.

There is most likely going to be a problem when we add support for background tasks that use console (i.e. the background task will not be able to use the console while the foreground task waits for input). Nevertheless, the problem will occur with the old pending mechanism too.

comment:4 Changed 10 years ago by Jakub Jermář

Status: assignedaccepted

comment:5 Changed 10 years ago by Jakub Jermář

Resolution: fixed
Status: acceptedclosed

Fixed in revision 4571.

Note: See TracTickets for help on using tickets.