Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#5190 closed patch (Fixed)

compile faulure ( on win32 )

Reported by: Buzz <davidbuzz@…> Owned by: Isaac Richards
Priority: trivial Milestone: 0.22
Component: mythtv Version: head
Severity: high Keywords: win32 mythcontext
Cc: Ticket locked: no

Description

function isatty() (line 982-ish) is part of <unistd.h>, so that needs to be included for MingW/win32 to build it properly.

patch: Index: mythcontext.cpp =================================================================== --- mythcontext.cpp (revision 17011) +++ mythcontext.cpp (working copy) @@ -37,6 +37,7 @@

#ifdef USING_MINGW #include <winsock2.h>

+#include <unistd.h>

#undef DialogBox? #include "compat.h" #endif

Change History (5)

comment:1 Changed 16 years ago by Nigel

Resolution: fixed
Status: newclosed

(In [17067]) MinGW needs unistd.h. Patch from David Buzz. Closes #5190. Also removed an undef that is already in compat.h

comment:2 Changed 13 years ago by danielk

Resolution: fixedFixed

(In [27283]) Fixes #5190. This tweaks file writing and reading a bit to better interact with modern VM and disk i/o schedulers.

To explain... First, we were sometimes using the wrong syscall to sync data to disk in the TFW. The sync_file_range call only syncs allocated blocks, which is often a no-op when appending to a file. It is useful for database type workloads, but what we really want is fdatasync(). Second, we were only using posix_fadvise to tell the OS what we wanted it to cache (some of the time), but we were not using it to hint to the OS what data we won't need in the near future. I've added the hinting for the seek to end optimization and I've added the calls to tell the OS what data we don't need it to cache. The later is important for Linux in particular as it will penalize the next application that requests memory for our sins in keeping unneeded disk buffers in memory after we're done with them.

This is based on Ingo Molnar's comments in the "The State of Linux IO Scheduling For the Desktop" story on slashdot.org 2010-10-24, I've run it for several weeks without any problems. It does not have as great a positive effect as I had hoped, but it does provide some benefit. This may provide more benefit on machines with less RAM.

comment:3 Changed 13 years ago by danielk

(In [27284]) Refs #5190. Ooops, too much committed in [27283].

comment:4 Changed 13 years ago by danielk

(In [27285]) Fixes #5190. This tweaks file writing and reading a bit to better interact with modern VM and disk i/o schedulers.

To explain... First, we were sometimes using the wrong syscall to sync data to disk in the TFW. The sync_file_range call only syncs allocated blocks, which is often a no-op when appending to a file. It is useful for database type workloads, but what we really want is fdatasync(). Second, we were only using posix_fadvise to tell the OS what we wanted it to cache (some of the time), but we were not using it to hint to the OS what data we won't need in the near future. I've added the hinting for the seek to end optimization and I've added the calls to tell the OS what data we don't need it to cache. The later is important for Linux in particular as it will penalize the next application that requests memory for our sins in keeping unneeded disk buffers in memory after we're done with them.

This is based on Ingo Molnar's comments in the "The State of Linux IO Scheduling For the Desktop" story on slashdot.org 2010-10-24, I've run it for several weeks without any problems. It does not have as great a positive effect as I had hoped, but it does provide some benefit. This may provide more benefit on machines with less RAM.

comment:5 Changed 13 years ago by danielk

Obviously the last few comments were intended for #9150.

Note: See TracTickets for help on using tickets.