Yield() not proper ? Programming Software Development by bigsurya …print("|"); cnt=1; if(cnt==1) this.yield(); sleep(1000); }catch(Exception e){} } } }…print("*"); cnt=0; if(cnt==0) this.yield(); sleep(1000); }catch(Exception e){} } } }… Re: Yield() not proper ? Programming Software Development by phriendtj … I do know that you either need to sleep, OR yield() not both.... yielding doesn't put the thread to sleep… Re: Yield() not proper ? Programming Software Development by bigsurya and I do intend to relinquish the processor hence using yield()...m using sleep() coz d processor is quiet fast n it process d entire thing in a single shot without giving d other thread a chance to execute What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by daudiam … the following statement [QUOTE]The Hotspot VM now implements Thread.yield() using the Windows SwitchToThread() API call. This call makes the…;http://www.javamex.com/tutorials/threads/yield.shtml"]http://www.javamex.com/tutorials/threads/yield.shtml[/URL] I understand that after… Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by pbl Windows In the Hotspot implementation, the way that Thread.yield() works has changed between Java 5 and Java 6.… In Java 5, Thread.yield() calls the Windows API call Sleep(0). This has … this behaviour was changed. The Hotspot VM now implements Thread.yield() using the Windows SwitchToThread() API call. This call makes … VB no Yield Return? Programming Software Development by overwraith … vb, but unfortunately vb doesn't seem to have a yield return operator. How do most vb developers do this, and… why is there no yield return, it kind of strikes me as a bit odd…#. public static IEnumerable<String> MyMethod(Arg arg){ while(...){ yield return myValue; } }//end method Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by ~s.o.s~ … ms under Windows; under Linux, it is 1ms[/quote] BTW, yield is not about processes; it's about threads. Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by ~s.o.s~ … threads are given time slices[/quote] Yes, but "Thread.yield", as mentioned in your original post specifically refers to… Re: VB no Yield Return? Programming Software Development by ddanbe ? VB has evolved to C# with somewhat different syntax. It is also called VB.NET instead of just VB, VB4-5-6 or VBA. So yield exists. [See here](https://msdn.microsoft.com/en-us/library/hh156729.aspx). Find implied Yield not yielding right answer Programming Software Development by riotburn I am trying to find the yield of a bond given the bond price, coupon, and semiannual … Re: Yield() not proper ? Programming Software Development by bigsurya The o/p I desire is something like this: |*|*|*|*|*|*|*|*|*| Re: Yield() not proper ? Programming Software Development by phriendtj if you explicitly want the |*|*| and have to use two threads to do it, then use semaphores or locks to synchronize the threads Re: Yield() not proper ? Programming Software Development by bigsurya [QUOTE=phriendtj;1220777]if you explicitly want the |*|*| and have to use two threads to do it, then use semaphores or locks to synchronize the threads[/QUOTE] hey friend, I'm not a pro...whats a lock ? Re: Yield() not proper ? Programming Software Development by phriendtj if you don't know what a semaphore or a lock is, well you have some reading to do on concurrent processing... locks are a way a synchronizing threads to cooperate with one another... semaphore is a version of a lock which has a counter... they are classes in the java.util.concurrent library.... go to [url]http://java.sun.com/javase/6/docs/api/[/… Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by ~s.o.s~ [URL="http://www.javamex.com/tutorials/threads/thread_scheduling_2.shtml"]The explanation[/URL] is on the same site. Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by daudiam As far as I can make out, quantum is the total time that a process has to spend in order to complete. Time slices are the time intervals that each process is given, before its shifted to the end of the queue and other processes are given chance to execute. Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by daudiam I think that processes as well as threads are given time slices. Within the time slice, each process or thread has a specified quantum that it executes and then other threads execute their time quantums within the same time slice. I read it here : [URL="http://www.fcolakoglu.com/lottery_scheduling.html"]http://www.fcolakoglu.com/… Re: What're quantum and time slice in the context of Thread.yield() ? Programming Software Development by daudiam Right. But still what is the difference between time slice and quantum ? I am not able to understand. They are synonymous in most literature (even in Wikipedia). Why is a time slice allocated to processes when other processes can share a quantum in even that ? Re: VB no Yield Return? Programming Software Development by overwraith Ok, so the keyword I was missing was that it actually needs to have the "Iterator" Keyword. I had actually looked at that page, and I completely missed that nuance the first time. Thanks ddanbe! Re: VB no Yield Return? Programming Software Development by ddanbe Glad to be of help. Overlooking something happens to me all the time. :) Re: Find implied Yield not yielding right answer Programming Software Development by Salem But are you also aware of the inherent problems of floating point? [url]http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems[/url] Your code may be algorithmically correct, but from a computational view, the accumulation of inaccuracies is destroying your results. Look for places where you're trying to use a very large number with a very… Re: Find implied Yield not yielding right answer Programming Software Development by riotburn OK but I dont have a thing defined as float. Everything is double except for for(int i=0..... Re: Find implied Yield not yielding right answer Programming Software Development by thomas_naveen double stands for double precision floating point number in C++ Re: Find implied Yield not yielding right answer Programming Software Development by riotburn Well then I am using float but I don't think its the problem because I have similar programs using double and they work fine. Re: Find implied Yield not yielding right answer Programming Software Development by Salem > double n = 6.0; Why are you using a double to limit the range of an integer for loop? > but I don't think its the problem because I have similar programs using double and they work fine. Yes, it's a common argument. Deeply flawed, but common. "I made program x work therefore program y must be flawless" doesn't wash. We often … Re: Find implied Yield not yielding right answer Programming Software Development by riotburn How do you step the code one line at a time? I dont entirely understand what that means. I tried changing the n to int, didn't change anytthing. Re: Find implied Yield not yielding right answer Programming Software Development by riotburn Found the problem, the b_best function wasn't set to summate. needed to be best = best + ... Thanks everyone for your help Re: Find implied Yield not yielding right answer Programming Software Development by thomas_naveen Better check out line 98 as well. It looks very similar to the bug you have identified. Re: Find implied Yield not yielding right answer Programming Software Development by riotburn Yes you are right, it was right to 10E-5 now its dead on. Thanks WPF-DataGrid and SubDataGrid using MVVM Programming Software Development by KushMishra …} public IEnumerable<ParentGridClass> ParentGridData { get { yield return new ParentGridClass { Customer = 324234, Name = … Payment = "Card", SubGridData = sublst }; yield return new ParentGridClass { Customer = 97887, Name = &…