qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Conway <acon...@redhat.com>
Subject Re: [Qpid-dispatch] timespec not defined on Windows
Date Mon, 25 Apr 2016 19:30:37 GMT
On Mon, 2016-04-25 at 15:11 +0200, Adel Boutros wrote:
> Unless you really insist on having a full C compatible code with the
> minimal dependencies. In that case, I will have to write/adapt the
> equivalent code/logic for pthread_mutex_t, pthread_cond_t,
> pthread_rwlock_t and pthread_t on Windows.
> 

Hi Adel,

I've been working on concurrent IO alternatives to the proton reactor
in Go, C++ and Ruby. I'm thinking about a C integration with libuv to
give proton concurrent, high-performance IO that is also portable. I
was also considering this project as a possible improved IO driver for
qpid dispatch.

If you are getting dispatch working on windows perhaps we should work
together.

I'm not married to libuv yet, but it seems the front runner. I'm
interested in hearing of gotchas or alternatives. 

libuv does provide the basic thread/lock abstractions you mention,
although I can't tell you yet how good they are yet.

Cheers,
Alan.

> > 
> > From: adelboutros@live.com
> > To: users@qpid.apache.org
> > Subject: RE: [Qpid-dispatch] timespec not defined on Windows
> > Date: Mon, 25 Apr 2016 14:35:19 +0200
> > 
> > Hello Ted,
> > I agree an abstraction level is required but for the time being I
> > am following the TDD approach. So once I have something working, I
> > will refactor it before submitting any patches. I will go with
> > something and only granular to milliseconds as you propose.
> > I am also facing another issue which might require adding a boost
> > dependency and it's related to the pthread library which is not
> > available on Windows. After checking Qpid C++ broker code, it was
> > solved on Windows by using boost thread library.
> > You can check for example https://github.com/apache/qpid/blob/trunk
> > /qpid/cpp/src/qpid/sys/windows/Mutex.h
> > So, how about adding a dependency to boost only for windows
> > platform via Cmake? This way, I can be inspired by Qpid C++ Broker
> > code for threading and no extra dependency is added for
> > Linux/Unix.Or do you propose something better?
> > PS: At some point, it might even be intelligent to extract the
> > common code from Qpid C++ broker, Proton and Dispatcher to create a
> > common "utils" library for threading, logging, daemon/service
> > creation ...
> > Regards,Adel
> > 
> > > 
> > > Subject: Re: [Qpid-dispatch] timespec not defined on Windows
> > > To: users@qpid.apache.org
> > > From: tross@redhat.com
> > > Date: Fri, 22 Apr 2016 12:35:50 -0400
> > > 
> > > Adel,
> > > 
> > > First of all, we should create an abstraction for timespec that
> > > is 
> > > usable on all platforms and then provide OS-specific
> > > implementations. 
> > > Dispatch doesn't currently need time at granularity above
> > > milliseconds.
> > > 
> > > To answer your question, I don't want to solve this in a way
> > > that 
> > > requires new dependencies in Linux like Boost.
> > > 
> > > -Ted
> > > 
> > > On 04/22/2016 12:24 PM, Adel Boutros wrote:
> > > > 
> > > > Hello,
> > > > 
> > > > While compiling Qpid-dispatch on Windows using Visual Studio
> > > > 2013 64-bit, I
> > > > encountered a code related to time which doesn't work under
> > > > windows.
> > > > 
> > > > In *src\server.c* thread_run method, there is a block of code
> > > > using timespec
> > > > which is not defined in Windows
> > > > 
> > > > /struct timespec tv;
> > > > clock_gettime(CLOCK_REALTIME, &tv);
> > > > qd_timestamp_t milliseconds = ((qd_timestamp_t)tv.tv_sec) *
> > > > 1000 +
> > > > tv.tv_nsec / 1000000;
> > > > qd_timer_visit_LH(milliseconds);/
> > > > 
> > > > I have found two ways to solve it:
> > > > 1) One inspired from Qpid C++ broker
> > > > (qpid\cpp\src\qpid\sys\windows\Time.cpp: FromEpoch and
> > > > outputHiresNow) but
> > > > this will add a dependency to Boost for qpid-dispatch.
> > > > 2) The other found on Stackoverflow  timespec-equivalent-for-
> > > > windows
> > > > <http://stackoverflow.com/questions/8583308/timespec-equivalent
> > > > -for-windows>
> > > > 
> > > > Which one would you find more appropriate?
> > > > 
> > > > Regards,
> > > > Adel Boutros
> > > > www.murex.com
> > > > 
> > > > 
> > > > 
> > > > --
> > > > View this message in context: http://qpid.2158936.n2.nabble.com
> > > > /Qpid-dispatch-timespec-not-defined-on-Windows-tp7642532.html
> > > > Sent from the Apache Qpid users mailing list archive at
> > > > Nabble.com.
> > > > 
> > > > -------------------------------------------------------------
> > > > --------
> > > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > > > For additional commands, e-mail: users-help@qpid.apache.org
> > > > 
> > > ---------------------------------------------------------------
> > > ------
> > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > > For additional commands, e-mail: users-help@qpid.apache.org
> > > 
> >  		 	   		  
>  		 	   		  

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message