profile
viewpoint

user827/xaskpass 1

A lightweight passphrase dialog

user827/rust-xcb-util 0

Rust bindings and wrappers for XCB utility functions.

user827/x11rb 0

X11 bindings for the rust programming language, similar to xcb being the X11 C bindings

push eventuser827/xaskpass

user827

commit sha e1e04772a6598b4fd51927210cb28e5ef2015af4

Remove cookie callbacks Lots of complexity and they might offer no gain, see https://github.com/psychon/x11rb/pull/642.

view details

user827

commit sha 311a01988d6ac7bcdb9dd923fc6feb31e0033086

Record time spend on a cycle

view details

user827

commit sha 72bf088743d0e78ac6b479ad51ee0529a46e0ba3

update dependencies

view details

user827

commit sha 68a86a0d9c7fd28d95fefefb8b8abc62ae2eb599

get deadline from screen refresh rates

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 8a286a759eb615edc81f98c9aa37c66588a630fd

get deadline from screen refresh rates

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha bbd10a053dfb73cfcc6f427be187d9d98527c241

Record time spend on a cycle

view details

user827

commit sha 0ad305d0e4ab0645c10d71a81ffe31cf9880e90b

update dependencies

view details

user827

commit sha 74d2da83d561f0966f0b5508e2d14eeb663519c8

get deadline from screen refresh rates

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 64f3d2c179f4c6103f8ef616e44c7f3d227ff51b

Remove cookies callbacks Lots of complexity and they might offer no gain, see https://github.com/psychon/x11rb/pull/642.

view details

push time in a month

PR closed psychon/x11rb

Add poll for reply functions and poll for queued events.

Hey, I wanted to know what it would look like to integrate cookie reply polling and dispatching into event loop and I have been wondering whether these are the kind of changes that would be needed in x11rb. Poll for queued events is there because it seemed to be the only way to ensure with libxcb that both reply and event queues have been emptied. Is there any interest in this kind of functionality or could I get better pointers about how using both event and reply polling in event loop should be done? I'm not sure how useful this functionality is either as I didn't find examples of how to do it.

Gotchas/TODO:

  • I have been looking at XcbConnection mainly.
  • Polling replies with rust connection does not read from socket (yet). Though I think it would be better if it didn't. If I understood correctly, in libxcb both poll_for_events and poll_for_reply read in events and replies from the socket which seems to make it hard to ensure that queues for both are empty. So complicated that I think I must have missed something (I'm trying it here).
  • I haven't implemented a version of poll_for_reply similar to wait_for_reply where the errors are left in the event loop. I'm not sure if it would even be useful as a polled version.
  • With these functions it isn't possible to know if there are still any errors from discarded replies left in queue when ending a cycle. Isn't that how it has been with poll_for_event always though?
+311 -16

7 comments

10 changed files

user827

pr closed time in a month

pull request commentpsychon/x11rb

Add poll for reply functions and poll for queued events.

Thanks for the detailed reply. I don't have anything to add for now, so maybe it's best to close this.

user827

comment created time in a month

pull request commentpsychon/x11rb

Add poll for reply functions and poll for queued events.

I'm hoping that writing to the socket would be much less of a problem because aren't the requests usually small enough so that multiple ones can be written before the socket starts to block? I also thought that one could usually avoid using bigger requests.

I don't know much know about the issues of having to give the ownership of the send buffers. Xaskpass has to avoid touching a buffer after a call to X present, so maybe those cases are at least doable.

Currently, though, I can see this pull request mainly paving the way for very complex solutions with very much uncertainty if they help with any real problem. So I don't feel pressured to having it accepted. I like being able to contribute though and can take a second look on the commented parts if you think it could be useful.

The next idea about avoiding blocking with also writes comes sadly from a lack of real experience with the solution: So to avoid stalling the event loop in every possible way, maybe one could use a separate thread to handle the sending part. Because I understood that libxcb likes to read from the fd also with sending commands the thread might not be able to avoid reading from the fd as well. So there would need to be one separate thread that handles all the reading and writing with the fd to ensure that no event or reply is missed before waiting the socket to become readable again. With this thread you wouldn't be able to avoid delaying the events and replies while it was writing but even then the event loop would be free to do something else.

I think this and any implementation of X specific thread that tries to read both events and replies without blocking would need poll_for_reply and poll_for_queued_event implemented or if libxcb compatibility was not needed, only poll_for_queued_reply.

I also hope the above was formulated well enough.

user827

comment created time in a month

pull request commentpsychon/x11rb

Add poll for reply functions and poll for queued events.

I do agree that xaskpass's event loop is clumsy for its purposes. I think this pull request is more about me tinkering with lightweight guis, sorry. I appreciate your comments.

I think the main issue this pull request tries to solve is how to avoid stalling the event loop if it takes too long for a reply to come. I cannot say if that is ever an issue in the real world though and I wouldn't be surprised if there are simpler solutions for this. I was fearing that using multiple threads would make the code more complicated in other ways or maybe wouldn't be that efficient. Is there a simpler solution to late replies with conn.wait_for_event(); send_event_via_channel?

user827

comment created time in a month

push eventuser827/x11rb

user827

commit sha aec56e439653af708156b3370d1a5427acd49ec9

Cargo check fixes

view details

push time in a month

push eventuser827/x11rb

user827

commit sha 620cf7e157ff631451e36e8e59e26d00c77876eb

Cargo check fixes

view details

push time in a month

PR opened psychon/x11rb

Add poll for reply functions and poll for queued events.

Hey, I wanted to know what it would look like to integrate cookie reply polling and dispatching into event loop and I have been wondering whether these are the kind of changes that would be needed in x11rb. Poll for queued events is there because it seemed to be the only way to ensure with libxcb that both reply and event queues have been emptied. Is there any interest in this kind of functionality or could I get better pointers about how using both event and reply polling in event loop should be done? I'm not sure how useful this functionality is either as I didn't find examples of how to do it.

Gotchas/TODO:

  • I have been looking at XcbConnection mainly.
  • Polling replies with rust connection does not read from socket (yet). Though I think it would be better if it didn't. If I understood correctly, in libxcb both poll_for_events and poll_for_reply read in events and replies from the socket which seems to make it hard to ensure that queues for both are empty. So complicated that I think I must have missed something (I'm trying it here).
  • I haven't implemented a version of poll_for_reply similar to wait_for_reply where the errors are left in the event loop. I'm not sure if it would even be useful as a polled version.
  • With these functions it isn't possible to know if there are still any errors from discarded replies left in queue when ending a cycle. Isn't that how it has been with poll_for_event always though?
+291 -16

0 comment

9 changed files

pr created time in a month

push eventuser827/xaskpass

user827

commit sha 18532bed649c9a6f154f6b07a994bf8fde890318

update dependencies

view details

push time in a month

push eventuser827/x11rb

Eduardo Sánchez Muñoz

commit sha 9222d432e92d74c024ed552e0e04df364fbc4b12

generator: use `std::fs::read` and `std::fs::write` instead of reinventing the wheel

view details

Eduardo Sánchez Muñoz

commit sha 38b34d4a48d4003b36394a7b6ffcb9035793c5f9

CI: clear the `src/protocol` directory before running the generator This would allow to detect if some unwanted garbage got into that directory

view details

mergify[bot]

commit sha 3138340914c42188acc3357fe805eb3bc2092981

Merge pull request #639 from psychon/use-std_fs generator: use `std::fs::read` and `std::fs::write` instead of reinventing the wheel

view details

mergify[bot]

commit sha 198f62ca959a9285e5cc79e062e4d02265009d82

Merge pull request #640 from psychon/ci-clear-protocol CI: clear the `src/protocol` directory before running the generator

view details

user827

commit sha 5736a49e4f69705e904b70a0b2e1b777b7d290e6

Add poll for reply functions and poll for queued events.

view details

push time in a month

push eventuser827/x11rb

user827

commit sha b189c938135fc4341ce647aa017584ae8fa5528f

Add poll for reply functions and poll for queued events.

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 37d22fa5399a9f36dccfc9a795332518bb2efd7f

Don't flush until queues are empty. Fix bug

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 0d2d3b74efbc66a621d867454a32bab49877f120

Don't flush until queues are empty. Fix bug

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 5e307d6a8fda9eded5d80e56108a2f2cd3246cee

Ensure render extension is compatible

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 83b244d3d265e5c8c7dfdba51b92833cfd4e8c39

Fix option description

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 0f3082cf04bc70de0889355b752960c7db949ed0

update dependencies

view details

push time in a month

push eventuser827/x11rb

Eduardo Sánchez Muñoz

commit sha 25ba14306d98bcd1aaf9af86497b2d7b33f60b99

generator: use `std::fs::read` and `std::fs::write` instead of reinventing the wheel

view details

Eduardo Sánchez Muñoz

commit sha 4406f895079f6660452a971ba5ae63508b73af45

CI: clear the `src/protocol` directory before running the generator This would allow to detect if some unwanted garbage got into that directory

view details

user827

commit sha 084c2e28dcfac648dd906a7f1c6d049616eaf4fe

Start implementing poll for replies and queued events Currently XcbConnection reads packets from socket but RustConnection does not. Polling replies without reading packets seems like a useful feature but that cannot be achieved with the underlying libxcb.

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 23782e4c8bfadaf9a3e7f3591bde58f07667c05d

Try to be more explicit

view details

user827

commit sha 842938f363d19fb2a582b2e23cf32bc7e393d635

Refactor

view details

push time in a month

push eventuser827/x11rb

user827

commit sha d192563fa0ed01aed39ef8dcff50f9be24e4515f

Start implementing poll for replies and queued events Currently XcbConnection reads packets from socket but RustConnection does not. Polling replies without reading packets seems like a useful feature but that cannot be achieved with the underlying libxcb.

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 0d7a20cf557b6afe6d5f861f22e48668e69e5940

It's like this

view details

user827

commit sha dc40e867997032cdf416fafe3ae538fe5a3df850

Try to be more explicit

view details

user827

commit sha 20e5f27aa6337e75782b7ec3301a86ab828bcbb8

Refactor

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha c6b295757c5544500932237fc9f26bf31d804c67

Try to be more explicit

view details

user827

commit sha 76f37482d1b1a7e7a1b3722013727116f190a186

Refactor

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha c32e2844bb1462545d094ea6b477eaf2a0f1579c

Refactor

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 2e3807c6381ba36cb7441b423dd1f5d6b711a1c0

Fix bugs

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha a7d656aa56730cfb00f92e56132e206d3c8a0dac

Fix bugs

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 53939179adf9dacdf73cb8ef958943d166e80c63

Fix bugs

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha bc5182b03ee3d92ba14ce6dd880d276fc5aa82ef

Fix bugs

view details

push time in a month

push eventuser827/xaskpass

user827

commit sha 514016b2d4a1223496d0a2005f3f330f29799058

Fix bugs

view details

push time in a month

more