The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
Re: Multithreading and concurrency?
[Originally posted by e.papalini]

Only a note:
I haven't understood that Pocker DB layer: if you store the score in the
"games" table without storing any session identification, how can you say that
the engine fully supports multiple users? Do I miss some details? If not,
Every player would see the same score.

I hope to have some hits about how to support multiple users playing different
games.

Thank you
Enrico
import-bot (20211) [Avatar] Offline
#2
[Originally posted by e.papalini]

Hi Fergal,
first of all thank you for your very clear and well-written book about .net
framework. I've bought the ebook version and I've found it a very good
starting point for .net.

I'm a bit disappointed for the lacking of explanation of multithreading and
concurrency: the poker engine is well designed if used in a single-user
environment, but I think it is a bit unrealistic as engine accessible from the
net. I haven't found any concurrent multiuser support, nor any server
multithreading technique.

Can you give me some references about those two topics? Any plan to implement
and release a multiuser version of your poker engine? I feel your book one
more chapter for this.

Thank you in advance
Enrico
import-bot (20211) [Avatar] Offline
#3
Re: Multithreading and concurrency?
[Originally posted by fgrimes]

Hi Enrico,

>> thank you for your very clear and well-written book...

Thanks, I'm glad you like it.

>> I'm a bit disappointed for the lacking of explanation
>> of multithreading and concurrency...

I considered including some material. But since few working programmers use
multithreading in their day-to-day projects, I decided not to bloat the book
with it.

>> the poker engine is well designed if used in a single-user
>> environment, but I think it is a bit unrealistic as engine
>> accessible from the net. I haven't found any concurrent
>> multiuser support, nor any server multithreading technique.

I fear you misunderstand the distinction between multiple threads and multiple
users. The poker engine fully supports multiple users. Multithreading would
be of no benefit in this case.

>> Can you give me some references about those two topics?

There are numerous examples at the many .NET/C# sites. Try
http://www.c-sharpcorner.com/Multithreading.asp, for example. Also the Donkey
.NET example at MSDN includes a multi-threaded UI. It is written in VB but
the objects would be identical in C#.

Regards,
Fergal

import-bot (20211) [Avatar] Offline
#4
Re: Multithreading and concurrency?
[Originally posted by fgrimes]

Hi Enrico,

>> Every player would see the same score.

Yes. In fact, the CokPok/WinPok apps clearly display the message "Machine
Stats (All Players)". We're interested in the machine's profit, not the
performance of individual players, since this is the way a casino machine
works.

>> how can you say that the engine fully
>> supports multiple users?

Because it fully supports multiple concurrent users.

Think of it like this: it is the machine versus the world. In other words,
if you are a casino operator, you care about the profit the machine makes.
You're not interested in the names or identities of those who lost money.

By all means, go ahead and amend the app to record individual scores, if you
like. (You won't need multiple threads to do so.) But if you do, don't use
an ASP.NET session ID to identify players, since this would make the engine
dependent on ASP.NET hosting.

Regards,
Fergal
import-bot (20211) [Avatar] Offline
#5
Re: Multithreading and concurrency?
[Originally posted by e.papalini]

Thank you very much.
Enrico
import-bot (20211) [Avatar] Offline
#6
Re: Multithreading and concurrency?
[Originally posted by alandennis]

Hello Enrico,

I'm putting the finishing touches on a book about multithreading that will be
published by Manning very soon. While I don't cover multithreaded poker
playing I do cover multithreaded concepts in great detail. The book features
examples in C# and Visual Basic .NET. All examples will be available from
Manning.com. I hope you can wait until it's published.

Thank you,
Alan Dennis
import-bot (20211) [Avatar] Offline
#7
Re: Multithreading and concurrency?
[Originally posted by ekinated]

Alan,

I too am interested in your book on multi-threading. When is it being
published? Do you have a viewable TOC?