namespace Wiegand
{
    public class ThreadPool
    {
        private System.Collections.Queue _queue = new System.Collections.Queue();
        public long QueueLength()
        {
            lock (this._queue) { return this._queue.Count; }
        }
        public Object Dequeue()
        {
            lock (this._queue) { return this._queue.Dequeue(); }
        }
        public void Enqueue(Object value)
        {
            lock (this._queue) { _queue.Enqueue(value); }
        }
        public void RunThreads(int threadCount, System.Threading.ParameterizedThreadStart pts)
        {
            // now, start the threads
            // since threadpool only actually runs one thread at a time, it is not ideal for this situation
            System.Collections.Generic.List threads = new List(threadCount);
            for (int i = 1; i <= threadCount; i++)
            {
                Thread thread = new Thread(pts);
                threads.Add(thread);
                thread.Start();
            }
            foreach (System.Threading.Thread thread in threads)
            {
                thread.Join(); // wait for each to finish
            }
            // done!
        }
        public void RunThreads(int threadCount, System.Threading.ThreadStart pts)
        {
            // now, start the threads
            // since threadpool only actually runs one thread at a time, it is not ideal for this situation
            System.Collections.Generic.List threads = new List(threadCount);
            for (int i = 1; i <= threadCount; i++)
            {
                Thread thread = new Thread(pts);
                threads.Add(thread);
                thread.Start();
            }
            foreach (System.Threading.Thread thread in threads)
            {
                thread.Join(); // wait for each to finish
            }
            // done!
        }
    }
}
    
Wednesday, January 31, 2007
Multithreading ThreadPool class replacement
Sunday, January 28, 2007
My newest quote
One thing I've learned from Disney: there's a HUGE difference between good magic and bad magic. Good magic always comes with good clothes. Bad magic never does. So the next time you're being transformed from a mermaid to a human, check your dress afterwards!
Tuesday, January 16, 2007
Today
Sunday, January 14, 2007
Daily interaction with religion
Recent stuff
Yesterday: So, 
Yesterday dinner: All of us (
Work: I got the database, data access layer and business logic layer done. Well, mostly that is. I've still got to create a PropertyComps structure (not even going to call it a class), a function to call them up, and a MySql ASP.Net membership provider (although I'm really reconsidering using that, I think it'll depend on how the UI is supposed to work). Speaking of the UI, I should be getting the web design from them Monday, so I will probably review it, make my test pages use the proper UI, and create those simple pages that I hadn't yet because they were so simple. I'm on-target. Oh, and I think the pay side of things will come out alright in the end: Signal was paying me a certain amount, these guys almost the exact same amount. Signal was putting in an extra $500 a month to help defray medical insurance. Well, I was paying $800/month for a family on that. I can get private insurance with similar benefits (a little higher on the deductible, but office visits are just $25, and pregnancy isn't covered) for $300/month, which is kinda what I was paying out of paycheck before. So, we'll see with the first full paycheck, but I think things'll be OK. I get a REALLY nice work laptop too (been using my personal Celeron 1.8GHz for awhile now...): 3.0GHz Intel Core 2 Duo, 1.5 GB ram, 120GB hard drive. It will kick butt. I could (and probably will) totally virtualize the devel web server and devel db server (to help test the configuration). I get it (in theory) on Thursday. Fun fun fun!
The future: Well, we've got a friend who's almost certainly going to move in, at least on a trial basis. Got to make room for them (her and her 1yr old kid). That means clearing out the baby room (which we don't use except to change 
 
 Posts
Posts
 
 
