Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 23rd, 2007, 03:24 AM
Authorized User
Join Date: Sep 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Which Thread to use and How

I'd be really thankful if you review following architecture and let me know how to run each channel in one thread and which thread is proper for this:
I'm developing a chat application in which there are many rooms (referred to channel in code).

public class ChannelEngine : IChannelEngine
public bool AddChannel(string channelname)
        {//is called, through server.aspx, for creating each room
            lock( syncRoot )
                if( !ChannelExists( channelname ) )
                    if (Channels.Count >= Global.MaxRoomNum)
                        return false;

                    // Create Chat Engine for new channel
                    ChatEngine.ChatEngine channel = 
                        new ChatEngine.ChatEngine();                   

                    Channels.Add( channelname, channel);
            return true;
public class ChatEngine : IChatEngine
//this class contains a few functions that are called from client code every other second
The problem is that when users are in the same room they can chat without any problem but when one user switches to another room, the users in previous room cannot send/rec. text because those functions in ChatEngine are run completely only for the new room! I thought putting each room in one thread could help but I don't know how?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread was being aborted acko ASP.NET 1.0 and 1.1 Basics 15 March 26th, 2014 02:52 AM
a Thread argument beccali Java Basics 1 February 21st, 2007 06:12 AM
Thread was being aborted sohailmaroof ASP.NET 1.0 and 1.1 Basics 2 January 13th, 2007 02:25 AM
communiation between thread gunx Pro VB 6 3 May 10th, 2005 03:56 PM
Thread portability rax Linux 0 September 3rd, 2004 06:54 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.