Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 17 months ago

Closed 16 months ago

Last modified 15 months ago

#11250 closed Patch - Feature (fixed)

Reduce ThreadedFileWriter thread wakeup

Reported by: Rune Petersen <rune@…> Owned by: danielk
Priority: minor Milestone: 0.27
Component: MythTV - General Version: 0.26-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The writer thread will only write in chunks of 'kMinWriteSize' or larger.
Currently ThreadedFileWriter::Write() will wake up the writer thread every time, even if the chunk size condition isn't met.

The patch changes ThreadedFileWriter::Write() to only wake up the writer thread is the chunk size condition is met.

This reduces cpu usage by ~9% on a 700MHz Cortex-A9 when recording DVB HD content.

Attachments (1)

mythtv_ThreadedFileWriter_reduce_thread_wakeup.patch (630 bytes) - added by Rune Petersen <rune@…> 17 months ago.

Download all attachments as: .zip

Change History (5)

Changed 17 months ago by Rune Petersen <rune@…>

comment:1 Changed 17 months ago by danielk

  • Owner set to danielk
  • Status changed from new to accepted

comment:2 Changed 16 months ago by Daniel Thor Kristjansson <dkristjansson@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

In 8c4434a25a0c002bbfa971b90083e515a37d3f9c/mythtv:

Reduce ThreadedFileWriter? wakeups.

Fixes #11250. If there isn't enough data to actually bother writing
it to disk don't wake up the writer thread.

comment:3 Changed 16 months ago by Rune Petersen <rune@…>

Just my 2 cent:

I personally find "(writeBuffers.size() > 1)" is redundant and causes allot of bufferHasData.wakeAll() calls, but I can see that it is hard to prove it is safe.

overall it is still an improvement, thank you.

comment:4 Changed 15 months ago by wagnerrp

  • Milestone changed from unknown to 0.27

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.