|
Re: NSCondition
Hi,
Thanks for the sample code Sandor, I’ve now got it working correctly now and I’m really pleased with it. I realised what was wrong just before I went to sleep last night and just added the
Hi,
Thanks for the sample code Sandor, I’ve now got it working correctly now and I’m really pleased with it. I realised what was wrong just before I went to sleep last night and just added the
|
By
Dave
·
#540
·
|
|
Re: NSCondition
Dave,
Using NSCondition this is how I had envisioned it done. Note difference in enclosing scope of the NSCondition and loops in the processing of the objects to be consumed...
Sandor
Dave,
Using NSCondition this is how I had envisioned it done. Note difference in enclosing scope of the NSCondition and loops in the processing of the objects to be consumed...
Sandor
|
By
Sandor Szatmari
·
#539
·
|
|
NSCondition
Hi All,
I’ve almost got my threaded Consumer/Producer Working using NSThread and friends. However, under certain circumstances, I’m getting objects “stuck” on the queue and the Consumer thread
Hi All,
I’ve almost got my threaded Consumer/Producer Working using NSThread and friends. However, under certain circumstances, I’m getting objects “stuck” on the queue and the Consumer thread
|
By
Dave
·
#538
·
|
|
Re: string pointer
Yes, it has to do with autorelease, but there are usually options for getting a non-autoreleased version, e.g. usually an init method to create it, however you are (were) stuck with an released
Yes, it has to do with autorelease, but there are usually options for getting a non-autoreleased version, e.g. usually an init method to create it, however you are (were) stuck with an released
|
By
Dave
·
#537
·
|
|
Re: horizontally scrolling table
I think there are two issues:
1. There is no automatic way to do this. You would need to compute the desired column width, then compute the desired outline view width, and resize the outline view.
I think there are two issues:
1. There is no automatic way to do this. You would need to compute the desired column width, then compute the desired outline view width, and resize the outline view.
|
By
Quincey Morris
·
#536
·
|
|
Re: string pointer
That's [was] true of any value. Whether it's a method return value or an 'out' parameter makes no difference. If you didn't retain it, you didn't own it, and it might go away.
So this really has
That's [was] true of any value. Whether it's a method return value or an 'out' parameter makes no difference. If you didn't retain it, you didn't own it, and it might go away.
So this really has
|
By
Jens Alfke
·
#535
·
|
|
horizontally scrolling table
I have a view-based NSOutlineTable with a single column containing static text. How do I make the column resize appropriately so that the table will scroll horizontally, rather than
I have a view-based NSOutlineTable with a single column containing static text. How do I make the column resize appropriately so that the table will scroll horizontally, rather than
|
By
James Walker
·
#534
·
|
|
Re: Changing head item on a (GCD) Queue
Hi,
I get it now, in this case the predicate is actually the (protected) Array, I’ve changed it yet again it just process one item at time. I’ll test it tomorrow and then add higher level code to
Hi,
I get it now, in this case the predicate is actually the (protected) Array, I’ve changed it yet again it just process one item at time. I’ll test it tomorrow and then add higher level code to
|
By
Dave
·
#533
·
|
|
Re: Changing head item on a (GCD) Queue
Hi Jonathan,
I missed NSCondition, thanks a lot. One thing I’m not sure about is the “boolean predicate”, from looking at the documentation, I can’t see that it is needed in this case unless
Hi Jonathan,
I missed NSCondition, thanks a lot. One thing I’m not sure about is the “boolean predicate”, from looking at the documentation, I can’t see that it is needed in this case unless
|
By
Dave
·
#532
·
|
|
Re: Changing head item on a (GCD) Queue
I came up with the following (untested). Any ideas on how replace the sleepForTimeInterval calls with a proper signal mechanism greatly appreciated.
All the Best
Dave
// The LTWQueue class ensures
I came up with the following (untested). Any ideas on how replace the sleepForTimeInterval calls with a proper signal mechanism greatly appreciated.
All the Best
Dave
// The LTWQueue class ensures
|
By
Dave
·
#531
·
|
|
Re: Changing head item on a (GCD) Queue
Look at NSCondition, which works with NSThread. I’m assuming you are re-implementing GetQueueHeadAndWait, and CheckData along with the queue that they operate on. The queue would consist of an
Look at NSCondition, which works with NSThread. I’m assuming you are re-implementing GetQueueHeadAndWait, and CheckData along with the queue that they operate on. The queue would consist of an
|
By
Jonathan Prescott
·
#530
·
|
|
Re: Changing head item on a (GCD) Queue
Hi,
I’m looking at the NSThread level and I can’t see anything that allows a thread to sleep until an event occurs (other than sleepUntilDate
and sleepForTimeInterval) or signal a thread for
Hi,
I’m looking at the NSThread level and I can’t see anything that allows a thread to sleep until an event occurs (other than sleepUntilDate
and sleepForTimeInterval) or signal a thread for
|
By
Dave
·
#529
·
|
|
Re: string pointer
The difference is in the amount of resources available to each of us. If you were to take into account he reliability of my software given the amount of resources I have available then I’d score
The difference is in the amount of resources available to each of us. If you were to take into account he reliability of my software given the amount of resources I have available then I’d score
|
By
Dave
·
#528
·
|
|
Re: Changing head item on a (GCD) Queue
Can you have a queue manager class observe the count of items in the array and wake itself up when that increments? Then it would stay awake until the queue is empty.
Something like...
NSMutableArray
Can you have a queue manager class observe the count of items in the array and wake itself up when that increments? Then it would stay awake until the queue is empty.
Something like...
NSMutableArray
|
By
Sandor Szatmari
·
#527
·
|
|
Re: Changing head item on a (GCD) Queue
Thanks Jens and Quincey, I think the best solution is to do what Jens suggested which is to have a custom thread type arrangement and share an Array as the Queue and protect it with a Lock/Mutex. The
Thanks Jens and Quincey, I think the best solution is to do what Jens suggested which is to have a custom thread type arrangement and share an Array as the Queue and protect it with a Lock/Mutex. The
|
By
Dave
·
#526
·
|
|
Re: Changing head item on a (GCD) Queue
You’re right, I misremembered. GCD has a DispatchWorkItem “cancel” method, which doesn’t have any proper documentation but I think dequeues the item (since GCD doesn’t have an actual
You’re right, I misremembered. GCD has a DispatchWorkItem “cancel” method, which doesn’t have any proper documentation but I think dequeues the item (since GCD doesn’t have an actual
|
By
Quincey Morris
·
#525
·
|
|
Re: Changing head item on a (GCD) Queue
Honestly I would just implement this in a fairly cross-platform way, by creating my own queue in an NSMutableArray. I'd have a thread reading items out of the queue and processing them, and the method
Honestly I would just implement this in a fairly cross-platform way, by creating my own queue in an NSMutableArray. I'd have a thread reading items out of the queue and processing them, and the method
|
By
Jens Alfke
·
#524
·
|
|
Re: string pointer
Without having used any apps you've written, I can't compare. And 'out' parameters are widely used in Cocoa programming, not just by Apple.
I honestly don't see anything dangerous about the code in
Without having used any apps you've written, I can't compare. And 'out' parameters are widely used in Cocoa programming, not just by Apple.
I honestly don't see anything dangerous about the code in
|
By
Jens Alfke
·
#523
·
|
|
Re: Changing head item on a (GCD) Queue
A little more on this.
I was thinking that in the example in my last email could (maybe) be handled like this:
The NSOperation class defines a method called something like “setNewData:(NSInteger)
A little more on this.
I was thinking that in the example in my last email could (maybe) be handled like this:
The NSOperation class defines a method called something like “setNewData:(NSInteger)
|
By
Dave
·
#522
·
|
|
Re: Changing head item on a (GCD) Queue
Hi Quincey,
I thought about using an NSOperationQueue but from what I can tell, when an operation is cancelled it stays on the queue until the NSOperation method gets called which check the
Hi Quincey,
I thought about using an NSOperationQueue but from what I can tell, when an operation is cancelled it stays on the queue until the NSOperation method gets called which check the
|
By
Dave
·
#521
·
|