argh
This commit is contained in:
parent
da0b890e84
commit
ac405862ba
@ -1,5 +1,8 @@
|
|||||||
31/12/12 started 7.30.7
|
31/12/12 started 7.30.7
|
||||||
- better option parsing for "vips", thanks Haida
|
- better option parsing for "vips", thanks Haida
|
||||||
|
- small fixes to help OS X
|
||||||
|
- removed sequential skip-ahead, it was not reliable on machines under
|
||||||
|
heavy load
|
||||||
|
|
||||||
14/11/12 started 7.30.6
|
14/11/12 started 7.30.6
|
||||||
- capture tiff warnings earlier
|
- capture tiff warnings earlier
|
||||||
|
38
TODO
38
TODO
@ -1,3 +1,41 @@
|
|||||||
|
- carrierwave-vips is doing
|
||||||
|
|
||||||
|
im_png2vips
|
||||||
|
vips_sequential
|
||||||
|
vips_linecache
|
||||||
|
vips_blockcache(), but upsizes
|
||||||
|
vips_sequential_generate() to delay ahead threads
|
||||||
|
im_shrink
|
||||||
|
im_tile_cache (old single-threaded vips7 tile cache)
|
||||||
|
im_affine
|
||||||
|
im_conv
|
||||||
|
im_vips2png
|
||||||
|
|
||||||
|
the im_tile_cache() single-threads, so one threads get out of order there,
|
||||||
|
no amount of delay in vips_sequential_generate() is going to fix it ...
|
||||||
|
we've deadlocked
|
||||||
|
|
||||||
|
vipsthumbnail does exactly the same thing
|
||||||
|
|
||||||
|
the comment there says that im_tile_cache() is necessary, since the conv
|
||||||
|
will force SMALLTILE, and that will break sequentiality
|
||||||
|
|
||||||
|
turning the im_tile_cache() into an im_copy() fixes the deadlock, but might
|
||||||
|
break for large shrink factors
|
||||||
|
|
||||||
|
try with im_tile_cache() disabled with vipsthumbnail and huge shrinks
|
||||||
|
|
||||||
|
perhaps swap the im_tile_cache() for another vips_sequential()? could we
|
||||||
|
then remove the one from png2vips?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
blocking bugs
|
blocking bugs
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
@ -181,7 +181,6 @@ vips_extract_area_class_init( VipsExtractAreaClass *class )
|
|||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
||||||
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
|
|
||||||
|
|
||||||
VIPS_DEBUG_MSG( "vips_extract_area_class_init\n" );
|
VIPS_DEBUG_MSG( "vips_extract_area_class_init\n" );
|
||||||
|
|
||||||
@ -192,8 +191,6 @@ vips_extract_area_class_init( VipsExtractAreaClass *class )
|
|||||||
vobject_class->description = _( "extract an area from an image" );
|
vobject_class->description = _( "extract an area from an image" );
|
||||||
vobject_class->build = vips_extract_area_build;
|
vobject_class->build = vips_extract_area_build;
|
||||||
|
|
||||||
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
|
||||||
|
|
||||||
VIPS_ARG_IMAGE( class, "input", 0,
|
VIPS_ARG_IMAGE( class, "input", 0,
|
||||||
_( "Input" ),
|
_( "Input" ),
|
||||||
_( "Input image" ),
|
_( "Input image" ),
|
||||||
|
@ -342,7 +342,6 @@ vips_insert_class_init( VipsInsertClass *class )
|
|||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
||||||
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
|
|
||||||
|
|
||||||
VIPS_DEBUG_MSG( "vips_insert_class_init\n" );
|
VIPS_DEBUG_MSG( "vips_insert_class_init\n" );
|
||||||
|
|
||||||
@ -353,8 +352,6 @@ vips_insert_class_init( VipsInsertClass *class )
|
|||||||
vobject_class->description = _( "insert an image" );
|
vobject_class->description = _( "insert an image" );
|
||||||
vobject_class->build = vips_insert_build;
|
vobject_class->build = vips_insert_build;
|
||||||
|
|
||||||
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
|
||||||
|
|
||||||
VIPS_ARG_IMAGE( class, "main", -1,
|
VIPS_ARG_IMAGE( class, "main", -1,
|
||||||
_( "Main" ),
|
_( "Main" ),
|
||||||
_( "Main input image" ),
|
_( "Main input image" ),
|
||||||
|
@ -45,8 +45,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
|
||||||
#define VIPS_DEBUG
|
#define VIPS_DEBUG
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -64,8 +64,11 @@
|
|||||||
#include "conversion.h"
|
#include "conversion.h"
|
||||||
|
|
||||||
/* Stall threads that run ahead for this long, in seconds.
|
/* Stall threads that run ahead for this long, in seconds.
|
||||||
|
*
|
||||||
|
* This has to be a long time: if we're trying to use all cores on a busy
|
||||||
|
* system it could be ages until all the other threads get a chance to run.
|
||||||
*/
|
*/
|
||||||
#define STALL_TIME (1.0)
|
#define STALL_TIME (10000.0)
|
||||||
|
|
||||||
typedef struct _VipsSequential {
|
typedef struct _VipsSequential {
|
||||||
VipsConversion parent_instance;
|
VipsConversion parent_instance;
|
||||||
@ -133,14 +136,11 @@ vips_sequential_generate( VipsRegion *or,
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( r->top > sequential->y_pos
|
if( r->top > sequential->y_pos ) {
|
||||||
//&& sequential->y_pos > 0
|
|
||||||
) {
|
|
||||||
GTimeVal time;
|
GTimeVal time;
|
||||||
|
|
||||||
/* We have started reading (y_pos > 0) and this request is for
|
/* This read is ahead of the current read point.
|
||||||
* stuff beyond that, stall for a short while to give other
|
* Stall for a while to give other threads time to catch up.
|
||||||
* threads time to catch up.
|
|
||||||
*/
|
*/
|
||||||
VIPS_DEBUG_MSG( "thread %p stalling for up to %gs ...\n",
|
VIPS_DEBUG_MSG( "thread %p stalling for up to %gs ...\n",
|
||||||
STALL_TIME, g_thread_self() );
|
STALL_TIME, g_thread_self() );
|
||||||
|
@ -392,6 +392,7 @@ int
|
|||||||
im_tile_cache( IMAGE *in, IMAGE *out,
|
im_tile_cache( IMAGE *in, IMAGE *out,
|
||||||
int tile_width, int tile_height, int max_tiles )
|
int tile_width, int tile_height, int max_tiles )
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Read *read;
|
Read *read;
|
||||||
|
|
||||||
if( tile_width <= 0 || tile_height <= 0 || max_tiles < -1 ) {
|
if( tile_width <= 0 || tile_height <= 0 || max_tiles < -1 ) {
|
||||||
@ -409,4 +410,7 @@ im_tile_cache( IMAGE *in, IMAGE *out,
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
*/
|
||||||
|
|
||||||
|
return( im_copy( in, out ) );
|
||||||
}
|
}
|
||||||
|
@ -407,9 +407,9 @@ png2vips_generate( VipsRegion *or,
|
|||||||
int y;
|
int y;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#endif /*DEBUG*/
|
|
||||||
printf( "png2vips_generate: line %d, %d rows\n",
|
printf( "png2vips_generate: line %d, %d rows\n",
|
||||||
r->top, r->height );
|
r->top, r->height );
|
||||||
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
/* We're inside a tilecache where tiles are the full image width, so
|
/* We're inside a tilecache where tiles are the full image width, so
|
||||||
* this should always be true.
|
* this should always be true.
|
||||||
|
@ -387,8 +387,9 @@ wbuffer_allocate_fn( VipsThreadState *state, void *a, gboolean *stop )
|
|||||||
*/
|
*/
|
||||||
wstate->buf = write->buf;
|
wstate->buf = write->buf;
|
||||||
|
|
||||||
VIPS_DEBUG_MSG( " allocated "
|
VIPS_DEBUG_MSG( " thread %p allocated "
|
||||||
"left = %d, top = %d, width = %d, height = %d\n",
|
"left = %d, top = %d, width = %d, height = %d\n",
|
||||||
|
g_thread_self(),
|
||||||
tile.left, tile.top, tile.width, tile.height );
|
tile.left, tile.top, tile.width, tile.height );
|
||||||
|
|
||||||
/* Add to the number of writers on the buffer.
|
/* Add to the number of writers on the buffer.
|
||||||
@ -415,13 +416,15 @@ wbuffer_work_fn( VipsThreadState *state, void *a )
|
|||||||
|
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
VIPS_DEBUG_MSG( "wbuffer_work_fn: %p %d x %d\n",
|
VIPS_DEBUG_MSG( "wbuffer_work_fn: thread %p, %d x %d\n",
|
||||||
state, state->pos.left, state->pos.top );
|
g_thread_self(),
|
||||||
|
state->pos.left, state->pos.top );
|
||||||
|
|
||||||
result = vips_region_prepare_to( state->reg, wstate->buf->region,
|
result = vips_region_prepare_to( state->reg, wstate->buf->region,
|
||||||
&state->pos, state->pos.left, state->pos.top );
|
&state->pos, state->pos.left, state->pos.top );
|
||||||
|
|
||||||
VIPS_DEBUG_MSG( "wbuffer_work_fn: %p result = %d\n", state, result );
|
VIPS_DEBUG_MSG( "wbuffer_work_fn: thread %p result = %d\n",
|
||||||
|
g_thread_self(), result );
|
||||||
|
|
||||||
/* Tell the bg write thread we've left.
|
/* Tell the bg write thread we've left.
|
||||||
*/
|
*/
|
||||||
|
@ -63,8 +63,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
|
||||||
#define DEBUG
|
#define DEBUG
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -347,6 +347,14 @@ vips_shrink_build( VipsObject *object )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf( "vips_shrink_build: shrinking %d x %d image to %d x %d\n",
|
||||||
|
resample->in->Xsize, resample->in->Ysize,
|
||||||
|
resample->out->Xsize, resample->out->Ysize );
|
||||||
|
printf( "vips_shrink_build: %d x %d block average\n",
|
||||||
|
shrink->mw, shrink->mh );
|
||||||
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
if( vips_image_generate( resample->out,
|
if( vips_image_generate( resample->out,
|
||||||
vips_shrink_start, vips_shrink_gen, vips_shrink_stop,
|
vips_shrink_start, vips_shrink_gen, vips_shrink_stop,
|
||||||
resample->in, shrink ) )
|
resample->in, shrink ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user