|
Re: NSCondition
Dave,
See below for what I'm talking about with the -wait call...
Additionally, think about where your testing -isCancelled and breaking out of the loop(s); you have multiple loops. Does that break,
Dave,
See below for what I'm talking about with the -wait call...
Additionally, think about where your testing -isCancelled and breaking out of the loop(s); you have multiple loops. Does that break,
|
By
Sandor Szatmari
·
#544
·
|
|
Re: NSCondition
Hi Again Sandor,
Yes, I’ve had similar fun doing the same thing here!
Thanks for the heads up on isCancelled and I’ll take your advice and store it as a property.
I’m not sure I understand
Hi Again Sandor,
Yes, I’ve had similar fun doing the same thing here!
Thanks for the heads up on isCancelled and I’ll take your advice and store it as a property.
I’m not sure I understand
|
By
Dave
·
#543
·
|
|
Re: NSCondition
Regarding the call to -isCancelled in the consumer thread... presumably you will have a handle to this thread somewhere and want to -cancel it gracefully prior to termination... Or cancel it and
Regarding the call to -isCancelled in the consumer thread... presumably you will have a handle to this thread somewhere and want to -cancel it gracefully prior to termination... Or cancel it and
|
By
Sandor Szatmari
·
#542
·
|
|
Re: NSCondition
Dave,
That's great I'm glad it's working! I had fun working up the sample... :) I let it run for a couple of hours watching the processes add a consume data. It was interesting to see how the
Dave,
That's great I'm glad it's working! I had fun working up the sample... :) I let it run for a couple of hours watching the processes add a consume data. It was interesting to see how the
|
By
Sandor Szatmari
·
#541
·
|
|
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
·
|